Skip to content
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

Module not found error #181

Closed
ctrlc03 opened this issue Jun 9, 2022 · 4 comments
Closed

Module not found error #181

ctrlc03 opened this issue Jun 9, 2022 · 4 comments

Comments

@ctrlc03
Copy link

ctrlc03 commented Jun 9, 2022

Hi there,

I am having some issues importing use-nft. Here is the error I get:

Compiled with problems:

ERROR in ./node_modules/use-nft/dist/index.js 5678:53-60

Module not found: Error: Can't resolve 'process/browser' in '/path/node_modules/use-nft/dist'
Did you mean 'browser.js'?
BREAKING CHANGE: The request 'process/browser' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

I am using:

  • React ^18.1.0
  • npm 8.12.1
  • node v16.14.0

The app was created using React-Create-App.

Has anyone got the same error and found a solution? Thanks.

@bpierre
Copy link
Owner

bpierre commented Jun 9, 2022

Hi, do you have the possibility to move to a bundler like vitejs.dev, Parcel or esbuild? CRA doesn’t seem to be actively maintained anymore (even though the React documentation still recommends it), and seems to have issues with ESM only modules.

If not possible, could you please reproduce the issue on a repo? Thanks!

@ctrlc03
Copy link
Author

ctrlc03 commented Jun 9, 2022

Thanks for getting back to me :)

I'll give these bundlers a try and if it doesn't work I'll try to reproduce it in another sample repo.

@ctrlc03
Copy link
Author

ctrlc03 commented Jun 9, 2022

I've switched to parcel and it works perfectly. Thank you

@ctrlc03 ctrlc03 closed this as completed Jun 9, 2022
@bpierre
Copy link
Owner

bpierre commented Jun 9, 2022

Awesome \o/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants