You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Visual Studio cannot find Typescript declaration file 'source-map' #449
Error TS6053 File 'path-to-my-project/node_modules/source-map/source-map' not found.
The file is in the program because: Root file specified for compilation
The cause of this error seems to be this line in package.json: "typings": "source-map",
If i change it to "typings": "source-map.d.ts",
then everythings works fine.
Looks like this was fixed in 2018. I had the same error; one of my dependencies depends on a much older version of source-map. It's probably fixable by using "overrides" in your package.json (as of npm version 8) to set a newer version of this library.
For me, this issue was occurring because @babel/generator still uses source-map@^0.5.0. They actually bumped the version two years ago, but then reverted it due to a regression (rather than fixing their codebase to work with the new version of source-map).
Maybe the fix can be backported into ^0.5 and ^0.6. I think this repo would need to create a branch for each of those minor versions before I could create a PR for them though.
Activity
oliverjam commentedon Feb 7, 2022
Looks like this was fixed in 2018. I had the same error; one of my dependencies depends on a much older version of
source-map. It's probably fixable by using"overrides"in yourpackage.json(as of npm version 8) to set a newer version of this library.jordanbtucker commentedon Feb 24, 2022
For me, this issue was occurring because @babel/generator still uses source-map@^0.5.0. They actually bumped the version two years ago, but then reverted it due to a regression (rather than fixing their codebase to work with the new version of source-map).
See: babel/babel#12025
If you run
npm ls source-mapyou can see the tree of which packages are dependent upon it. Here's what mine looks like:jordanbtucker commentedon Feb 24, 2022
Maybe the fix can be backported into ^0.5 and ^0.6. I think this repo would need to create a branch for each of those minor versions before I could create a PR for them though.