Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find a declaration file #825

Closed
jmeinlschmidt opened this issue Feb 15, 2024 · 11 comments · Fixed by #826 or #829 · May be fixed by AsimKhan2019/react-google-places-autocomplete#2
Closed

Could not find a declaration file #825

jmeinlschmidt opened this issue Feb 15, 2024 · 11 comments · Fixed by #826 or #829 · May be fixed by AsimKhan2019/react-google-places-autocomplete#2
Labels
priority: p0 Highest priority. Critical issue. P0 implies highest priority. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@jmeinlschmidt
Copy link

Environment details

 Node   : 20.11.0
 OS     : darwin-arm64
 npm    : 10.2.4

Using esbuild in Angular v17.2.1.

Steps to reproduce

This error fails a build while trying to import { Loader } from '@googlemaps/js-api-loader';

Stack trace

✘ [ERROR] TS7016: Could not find a declaration file for module '@googlemaps/js-api-loader'. '/Users/.../node_modules/@googlemaps/js-api-loader/dist/index.umd.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/googlemaps__js-api-loader` if it exists or add a new declaration (.d.ts) file containing `declare module '@googlemaps/js-api-loader';` [plugin angular-compiler]

    apps/.../google-maps.ts:2:23:
      2 │ import { Loader } from '@googlemaps/js-api-loader';
        ╵                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~


Watch mode enabled. Watching for file changes...

Thank you!

@jmeinlschmidt jmeinlschmidt added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Feb 15, 2024
@wangela
Copy link
Member

wangela commented Feb 15, 2024

If you would like to upvote the priority of this issue, please comment below or react on the original post above with 👍 so we can see what is popular when we triage.

@jmeinlschmidt Thank you for opening this issue. 🙏
Please check out these other resources that might help you get to a resolution in the meantime:

This is an automated message, feel free to ignore.

@jmeinlschmidt
Copy link
Author

jmeinlschmidt commented Feb 15, 2024

This error seems to be a regression after upgrading from 1.16.2 to 1.16.3 probably introduced by 3d221ea (cc @usefulthink)

@bjornharvold
Copy link

Yes, I am seeing this as well.

Example:

Could not find a declaration file for module '@googlemaps/js-api-loader'. '/Users/crash/git/monorepo-typescript/node_modules/@googlemaps/js-api-loader/dist/index.umd.js' implicitly has an 'any' type.
     Try `npm i --save-dev @types/googlemaps__js-api-loader` if it exists or add a new declaration (.d.ts) file containing `declare module '@googlemaps/js-api-loader';`
   
   12 import { Libraries } from '@googlemaps/js-api-loader';

@cgarrovillo
Copy link

cgarrovillo commented Feb 16, 2024

For anyone having this problem with a dependency they use that uses this library as a dependency, we were able to work around it using the overrides NPM config https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides

A notable library is the react-wrapper library that uses this library
googlemaps/react-wrapper#782 (comment)

@martincostello
Copy link

This doesn't appear to have fixed the issue: martincostello/apple-fitness-workout-mapper#1158

@samuelcole
Copy link

i still can't deploy 1.16.5:

build: ../../node_modules/@googlemaps/js-api-loader/dist/index.esm.js
build: Module parse failed: 'import' and 'export' may appear only with 'sourceType: module' (408:0)

@usefulthink
Copy link
Contributor

@samuelcole can you open a new issue for this? Also please add some more information about which build tools you are using. I'm not seeing this error in my current test-setups.

@wangela wangela added priority: p0 Highest priority. Critical issue. P0 implies highest priority. and removed triage me I really want to be triaged. labels Feb 16, 2024
@wangela wangela reopened this Feb 16, 2024
@wangela
Copy link
Member

wangela commented Feb 16, 2024

@martincostello are you still seeing the issue if you upgrade to v1.16.5?

@martincostello
Copy link

Nope, now I get the same new error as mentioned above: martincostello/apple-fitness-workout-mapper#1160

@usefulthink
Copy link
Contributor

fix is incoming.

@wangela
Copy link
Member

wangela commented Feb 16, 2024

These fixes should now be available in v1.16.6. Please reopen if the error persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p0 Highest priority. Critical issue. P0 implies highest priority. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
7 participants