Could not find TypeScript declaration for '../vendor/paho-mqtt'
See original GitHub issueIf you are using TypeScript and you try to install the latest version of aws-amplify
you will see the following error:
/Users/username/WebstormProjects/my-project/node_modules/@aws-amplify/pubsub/lib/Providers/MqttOverWSProvider.d.ts
(1,23): Could not find a declaration file for module '../vendor/paho-mqtt'. '/Users/username/WebstormProjects/my-project/node_modules/@aws-amplify/pubsub/lib/vendor/paho-mqtt.js' implicitly has an 'any' type.
Try `npm install @types/aws-amplify__pubsub` if it exists or add a new declaration (.d.ts) file containing `declare module 'aws-amplify__pubsub';`
Trying to install@types/aws-amplify__pubsub
doesnt help as it doesnt exist so the solution is to declare it yourself.
To Reproduce
- Error happens when starting up (
npm start
) a Create React App TypeScript project
Expected behavior No loading errors
Desktop (please complete the following information):
- OS: OSX
- Browser: n/a
- Version: n/a
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:15 (1 by maintainers)
Top Results From Across the Web
Could not find a declaration file for module 'module-name ...
In Node.js everything works fine, but TypeScript: import {Injector} from '@ts-stack/di' ...
Read more >How to fix error TS7016: Could not find a declaration file for ...
How to fix error TS7016: Could not find a declaration file for module 'XYZ'. 'file.js' implicitly has an 'any' type · Try `npm...
Read more >Documentation - Modules .d.ts - TypeScript
If you can't have esModuleInterop: true in your project, such as when you're submitting a PR to Definitely Typed, you'll have to use...
Read more >Fixing the TS7016 Error | Atomist Blog
4 Terrible Ways (and 4 Better Ways) to fix 'TS7016: Could not find declaration file'. My favorite thing about TypeScript is gradual typing....
Read more >TypeScript — Type Declaration Files | by Makesh Kumar
Could not find a declaration file for module '<module-name>'. Note: above issue will arise only if we enabled the strict property in the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A temporary fix, working for us:
Update your
tsconfig.json
:Same issue with