electron-vite / electron-vite-react

:electron: Electron + Vite + React + Sass boilerplate.
https://electron-vite.github.io
MIT License
1.82k stars 215 forks source link

[Help] dynamic import require is not supported #206

Open zacard-orc opened 6 months ago

zacard-orc commented 6 months ago

Describe the problem you confuse

hi , after i installed web3 tools, just like

"ethereumjs-util": "^7.1.5", "ethereumjs-wallet": "^1.0.2", "web3": "^1.8.0", "bip39": "^3.0.4", "crypto-js": "^4.1.1"

and then ,i apply these packages and run , then the renderer console tell me

Uncaught Error: Dynamic require of "crypto" is not supported

Uncaught Error: Dynamic require of "crypto" is not supported at chunk-35XAPQLS.js?v=e1dee1fd:10:9 at node_modules/.vite-electron-renderer/crypto.mjs (chunk-IKTF4L45.js?v=e1dee1fd:88:11) at __init (chunk-35XAPQLS.js?v=e1dee1fd:13:56) at node_modules/ethereumjs-wallet/dist.browser/index.js (ethereumjs-wallet.js?v=e1dee1fd:2957:33) at __require2 (chunk-35XAPQLS.js?v=e1dee1fd:16:50) at ethereumjs-wallet.js?v=e1dee1fd:3348:16

can anyone help me?

RSS1102 commented 6 months ago

Please provide a minimum reproduction question

RSS1102 commented 5 months ago

image I can use it normally. If you still have the blame issue, please provide your error code usage method. crypto-js