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:

image

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 10
  • Comments: 26 (9 by maintainers)

Commits related to this issue

Most upvoted comments

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

GENERATE_SOURCEMAP=false 

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.