detect-provider: Failed to parse source map - Error: ENOENT: no such file or directory
I’ve added the dependency: npm i @metamask/detect-provider
But getting this error:
Failed to parse source map from '/home/pomatti/pjs/uniswap/uniswap-widget/node_modules/@metamask/detect-provider/src/index.ts' file: Error: ENOENT: no such file or directory, open '/home/pomatti/pjs/uniswap/uniswap-widget/node_modules/@metamask/detect-provider/src/index.ts'
Only thing I’m doing is importing it:
import detectEthereumProvider from '@metamask/detect-provider';
No idea why it is complaining:
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 10
- Comments: 26 (9 by maintainers)
Commits related to this issue
- Fix failed to parse source map error (#42) — committed to maui-r/detect-provider by maui-r 2 years ago
- chore(compilation-warnings): ignore expected metamask compilation warnings per recommendation here https://github.com/MetaMask/detect-provider/issues/42#issuecomment-1777854386 no reason to keep the... — committed to fiatconnect/fiatconnect-widget by cajubelt 8 months ago
- chore(compilation-warnings): ignore expected metamask compilation warnings (#20) * chore(compilation-warnings): ignore expected metamask compilation warnings per recommendation here https://github... — committed to fiatconnect/fiatconnect-widget by cajubelt 7 months ago
We are trying to get a new version out the door that should solve this issue. Sorry for the wait folks 😃
This was useful for me - https://github.com/mswjs/msw/issues/1030#issuecomment-1009253387
Just add to
.env
Sorry for the late reply on this issue.
This problem should be fixed with 2.0.0 (release notes here), so if you’re still experiencing this issue, try updating to that version!
downgrading the version resolved my issue. @metamask/detect-provider": "1.0.0
@mcmire gave it a try but am still seeing the error
@alxlacayo Actually I figured out how to solve this. If you are using useDapp switch to v0.9.1 Get @metamask/detect-provider v1.2.0 and the latest version of react-scripts.
Run “npm audit fix --force” and I think you’ll fix your problem.