sei-protocol / sei-js

SeiJS is a monorepo that contains multiple NPM libraries for writing applications that interact with the Sei network.
44 stars 38 forks source link

[BUG] According to the first step of Javascript Reference, an error is reported #108

Closed ahaocoder closed 9 months ago

ahaocoder commented 10 months ago

SeiJS package & version "@sei-js/core": "^3.1.2", "@sei-js/proto": "^3.1.0", "@sei-js/react": "^3.2.0",

Describe the bug According to the first step of Javascript Reference, an error is reported npm install core/react/proto ERROR in ./node_modules/@cosmjs/crypto/build/pbkdf2.js 50:67-84 Module not found: Error: Can't resolve 'crypto' in '/Users/ahao/WebstormProjects/sei-react/node_modules/@cosmjs/crypto/build'

The following are some screenshots: image image image

besated commented 10 months ago

Hey @ahaocoder, could you provide a small code snippet or a sample project that reproduces the issue? This will be helpful for us to see exactly what's going wrong. Also, which bundler are you using? The suggested bundler in our docs is Vite.

From the logs, it looks like you're using webpack (>5), which doesn't include the crypto polyfill by default. So, you'll likely need to add something like https://github.com/Richienb/node-polyfill-webpack-plugin

besated commented 9 months ago

Closing for now. Feel free to reopen if you have more details!