-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: Vite build error #2228
Comments
Thanks for reporting. This issue is temporarily closed due to lack of information. Please provide a minimal reproducible example via a https://new.wagmi.sh fork and I'll reopen this issue. https://new.wagmi.sh is a Vite project that successfully compiles a wagmi application. Might be worth cross-referencing your app with that one. |
Sorry, I found the problem. I don't use any EventEmitter on my project, so I search dose anyone happended this problem too. I install vite-plugin-node-polyfills for my vite project, and add import { defineConfig } from 'vite';
import { resolve } from 'path';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
import react from '@vitejs/plugin-react';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
// I add this on my project
nodePolyfills({
protocolImports: true,
}),
],
// server: {
// host: '0.0.0.0',
// },
base: '/',
esbuild: {
drop: process.env.NODE_ENV === 'production' ? ['console', 'debugger'] : [],
},
resolve: {
alias: [
{
find: '@',
replacement: resolve(__dirname, 'src'),
},
{
find: '@utils',
replacement: resolve(__dirname, 'src/utils'),
},
{
find: '@constants',
replacement: resolve(__dirname, 'src/constants'),
},
{
find: '@store',
replacement: resolve(__dirname, 'src/store'),
},
{
find: '@components',
replacement: resolve(__dirname, 'src/components'),
},
{
find: '@assets',
replacement: resolve(__dirname, 'src/assets'),
},
],
},
}); I don't know why always build failed on jenkins, but sometime build success on local. |
This issue has been locked since it has been closed for more than 14 days. If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest wagmi version. If you have any other comments you can create a new discussion. |
Is there an existing issue for this?
Package Version
0.4.9
Current Behavior
I'm use wagmi on my project, here is my project basic setting:
I got error like
'EventEmitter' is not exported by __vite-browser-external, imported by node_modules/@walletconnect/jsonrpc-provider/dist/esm/provider.js file: xxxx/xxxx/xxxx/xxxx
, I don't use walletconnect on my project, so I think this is wagmi dependency, why I got this error?Expected Behavior
I expected build success.
Steps To Reproduce
Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: