question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Type declaration not found

See original GitHub issue

Importing this package in a typescript project results in the error:

Could not find a declaration file for module ‘web-vitals’. ‘<snip>/node_modules/web-vitals/dist/web-vitals.min.js’ implicitly has an ‘any’ type. Try npm install @types/web-vitals if it exists or add a new declaration (.d.ts) file containing declare module 'web-vitals';ts(7016)

I see the lib is written in typescript so I’m assuming this is a misconfiguration of the build, not that types are hosted in an types package

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
deasemscommented, May 8, 2020

Updated and import’s working as expected, thanks for the quick turnaround @philipwalton

0reactions
philipwaltoncommented, May 7, 2020

@deasems I just released v0.2.1, which should fix this. Please give it a try and let me know if you’re still having issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not find a declaration file for module 'module-name ...
When a module is not yours - try to install types from @types : ... such index.d.ts that'll contain all the missing declaration...
Read more >
Could not find declaration file for module 'X' Error | bobbyhadz
The error "Could not find a declaration file for module" occurs when TypeScript cannot find the type declaration for a module. To solve...
Read more >
How to fix error TS7016: Could not find a declaration file for ...
Try `npm install @types/XYZ` if it exists or add a new declaration (.d. · declare module 'XYZ';. Lastly, you also need to add...
Read more >
[TypeScript] Could not find a declaration file for module 'node ...
When using apollo-env through apollo-server, I get the following error during TypeScript builds: ...
Read more >
Error: Could not find a declaration file for module - YouTube
Fix error: Could not find a declaration file for module ... implicitly has an 'any' type.Try npm install library-name if it exists or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found