-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find module 'strtok3/core' or its corresponding type declarations. #1373
Comments
Yes there is: https://github.com/Borewit/strtok3/blob/91791f8f2ef80f905bdc0bc1088fd96ff2076ae9/package.json#L42 Problem is that your environment lacks proper ESM support, duplicate of #1217 |
How do I fix it? My node is v14.20.1 (latest in 14 branch) - is this causes a problem? |
Node version should be Tests are passing against the latest Node v14: https://github.com/Borewit/music-metadata/blob/master/.github/workflows/nodejs-ci.yml#L50 Maybe upgrade your TypeScript dev dependencies, seems on that level as it complaining about typings. |
I think the issue for most build tools (including the typescript compiler in the default configuration), is that the import should be to adding this to the compilerOptions of the tsconfig works:
or use The problem with the latter method is that is incompatible with many web packers (like Parcel or WebPack). In this case, you should use https://github.com/Borewit/music-metadata-browser instead. |
Thanks for sharing your experience @bradleat, on the long run I want to merge music-metadata-browser with (to) music-metadata, as ESM allows different import path for node.js and browser. Please also raise this shortcomings at the web bundlers not supporting this. ESM is the official standard format after-all. |
"music-metadata": "^8.1.0"
[{
"resource": "/c:/_WORK/link_metadata/node_modules/music-metadata/lib/apev2/APEv2Token.d.ts",
"owner": "typescript",
"code": "2307",
"severity": 8,
"message": "Cannot find module 'strtok3/core' or its corresponding type declarations.",
"source": "ts",
"startLineNumber": 2,
"startColumn": 27,
"endLineNumber": 2,
"endColumn": 41
}]
APEv2Token.d.ts tries to import { IGetToken } from 'strtok3/core';
There is no 'core' file or dir in node_modules/strtok3
The text was updated successfully, but these errors were encountered: