Could not find a declaration file for module ‘module-name’. ‘/path/to/module-name.js’ implicitly has an ‘any’ type

That feeling when you are looking out for two days and find it like this: just remove .js from "main": "dist/index.js" in package.json and everything works fine!

"main": "dist/index",

UPD: this answer relative if you have your own npm package, if not – see my answer below.

And if above answer not resolved import your module, try just add typings in package.json:

"main": "dist/index",
"typings": "dist/index",

Of course, here folder dist – it’s where stores your module’s files.

Leave a Comment