Closed ghost closed 2 months ago
This typings is added by a contributor. I'm not a TypeScript user myself so if you know how to fix it, I will happily merge the PR
Ok so, after doing some searching, I found this only throws an error when using strict mode for TypeScript. Then I found two ways of solving this :
"type":"module"
in my app's package.json, removing it removed the error. I was using it from a previous similar app but removing it did not affect things much. 👍"type":"module"
is necessary for you, find /node_modules/camaro/package.json and change "import": "./index.mjs"
to "import": "./index.js"
- that did not break anything for me and removed the error completely too.Not sure this is worth a PR @tuananh, as this should rarely ever happen to anyone and if it ever does, it's a very simple fix. I'm also worried it might break some projects that need the mjs extension for imports.
Cheers.
Describe the bug When trying to use the library in a TypeScript app, I'm getting the following error from VSCode :
Minimal Script To Reproduce Install camaro with pnpm, then simply import the library in a ts file.
Expected behavior Type declarations to be properly taken in account.