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.

Could not find a declaration file for module 'quagga'.

See original GitHub issue

I want to add quagga to React and when I import it with import Quagga from "quagga"; I get:

Could not find a declaration file for module 'quagga'. '___path___/node_modules/quagga/lib/quagga.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/quagga` if it exists or add a new declaration (.d.ts) file containing `declare module 'quagga';`ts(7016)

npm i --save-dev @types/quagga is not possible because ‘@types/quagga@latest’ is not in the npm registry. ``declare module ‘quagga’;` is not possible in vanilla JS as I know.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:19

github_iconTop GitHub Comments

1reaction
walejandromtcommented, Feb 6, 2022

I did not know this library have a new version in https://github.com/ericblade/quagga2 with quagga2 work for me thanks!

0reactions
justinevachercommented, Aug 28, 2022

I have the same error, I use React with Typescript. And I fixed it with the ignore tag :

// @ts-ignore import Quagga from 'quagga';

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not find a declaration file for module 'module-name ...
In order for this to work, I had to make declare module '...' the first line of code in the module.d.ts file, and...
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. ts) file containing `declare module 'XYZ'; If XYZ is...
Read more >
Could not find declaration file for module 'X' Error | bobbyhadz
The error "Could not find declaration file for module" occurs when TypeScript cannot find the type declaration for a module. To solve the...
Read more >
Could not find a declaration file for module 'mongodb ... - Reddit
Could not find a declaration file for module 'mongodb', despite library saying the types are included. I'm using NextJS and Typescript, with ...
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 Reddit Thread

No results found

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