[bug] react+vite Compatibility issues
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"
just add:
import { nodePolyfills } from 'vite-plugin-node-polyfills'