web3modal icon indicating copy to clipboard operation
web3modal copied to clipboard

[bug] react+vite Compatibility issues

Open dangdang02 opened this issue 2 years ago • 1 comments

Link to minimal reproducible example

react+vite Compatibility issues

Summary

chunk-W7S2ME4R.js?v=8a217cfe:18 Module "buffer" has been externalized for browser compatibility. Cannot access "buffer.Buffer" in client code. See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.

reactive-element.ts:92 Lit is in dev mode. Not recommended for production! See https://lit.dev/msg/dev-mode for more information.

reactive-element.ts:92 Multiple versions of Lit loaded. Loading multiple versions is not recommended. See https://lit.dev/msg/multiple-versions for more information.

chunk-W7S2ME4R.js?v=8a217cfe:18 Module "util" has been externalized for browser compatibility. Cannot access "util.inspect" in client code. See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.

List of related npm package versions

web3modal ethers5,"vite": "^4.3.2"

dangdang02 avatar Dec 06 '23 08:12 dangdang02

just add:

import { nodePolyfills } from 'vite-plugin-node-polyfills'

reslear avatar Apr 16 '24 05:04 reslear