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

Can't resolve net error with SiweMessage #167

Open
estarriolvetch opened this issue May 11, 2023 · 2 comments
Open

Can't resolve net error with SiweMessage #167

estarriolvetch opened this issue May 11, 2023 · 2 comments

Comments

@estarriolvetch
Copy link

Hi,

I'm using siwe with nextjs and ethers-v6. I got error message when I create SiweMessage

const message = new SiweMessage({....})

Below is the error message:

error - ./node_modules/ethers/node_modules/ws/lib/sender.js:5:0
Module not found: Can't resolve 'net'

Import trace for requested module:
./node_modules/ethers/node_modules/ws/index.js
./node_modules/ethers/lib.commonjs/providers/ws.js
./node_modules/ethers/lib.commonjs/providers/provider-websocket.js
./node_modules/ethers/lib.commonjs/providers/index.js
./node_modules/ethers/lib.commonjs/ethers.js
./node_modules/ethers/lib.commonjs/index.js
./node_modules/siwe/dist/utils.js
./node_modules/siwe/dist/siwe.js

According to https://flaviocopes.com/nextjs-fix-module-not-found/ , it seems this error is from Next.js is trying to run backend code in the frontend.

@w4ll3
Copy link
Member

w4ll3 commented May 11, 2023

have you included node-polyfills?

@asiniy
Copy link

asiniy commented May 22, 2023

node-polyfill-webpack-plugin solves the problem partially. Why can't you just add all the missing polyfills to the package?

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

3 participants