NextJs: Can't resolve 'bufferutil' and 'utf-8-validate'

Please provide the following details too when asking for help in this category:

  • SDK Version: 6.1.7
  • Platform: Mac (NextJs 13)
  • Terminal Console Screenshots:
./node_modules/ws/lib/buffer-util.js
Module not found: Can't resolve 'bufferutil' in '/path-to-app/node_modules/ws/lib'

Import trace for requested module:
./node_modules/ws/lib/buffer-util.js
./node_modules/ws/lib/receiver.js
./node_modules/ws/wrapper.mjs
./node_modules/ethers/lib.esm/providers/ws.js
./node_modules/ethers/lib.esm/providers/provider-websocket.js
./node_modules/ethers/lib.esm/providers/index.js
./node_modules/ethers/lib.esm/ethers.js
./node_modules/ethers/lib.esm/index.js
./app/hooks/web3auth/index.tsx

./node_modules/ws/lib/validation.js
Module not found: Can't resolve 'utf-8-validate' in '/path-to-app/node_modules/ws/lib'

Import trace for requested module:
./node_modules/ws/lib/validation.js
./node_modules/ws/lib/receiver.js
./node_modules/ws/wrapper.mjs
./node_modules/ethers/lib.esm/providers/ws.js
./node_modules/ethers/lib.esm/providers/provider-websocket.js
./node_modules/ethers/lib.esm/providers/index.js
./node_modules/ethers/lib.esm/ethers.js
./node_modules/ethers/lib.esm/index.js
./app/hooks/web3auth/index.tsx

Hey friends :wave:

Working with NextJs 13, web3Auth initialization and login process basically work. I just want to remove these errors from the console.

Troubleshooting on web3auth/docs website is for react, but I don’t understand how to solve this issue in nextjs 13 since it seems to be a webpack issue.

Please help :pray:

@david.nejar Welcome Aboard!

Your issue has been forwarded to our team and we will get back with further updates once more information becomes available.

1 Like

Thank you @vjgee :pray:

I am here if you need anything :sunflower:

Hi @david.nejar, just out of curiosity, do these warnings appear in the production optimised builds as well? If the warnings don’t show up in the production build, and you can live with them in development, you can choose to ignore them.

npm install ws bufferutil utf-8-validate

This should solve your issue if you really want to solve it. Let me know if this works on your end as i didn’t test it out

1 Like

For now, I am having issues with connection on mainnet, so I am not sure if these errors show in production. However, if they don’t I’ll close the topic :slight_smile:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.