I have a vite project that uses @walletconnect/client. Everything works fine with
npm run dev
but during build (npm run build
) I get these errors
error during build:
Error: 'removeHexPrefix' is not exported by node_modules/@walletconnect/encoding/dist/cjs/index.js, imported by node_modules/@walletconnect/utils/dist/esm/ethereum.js
I have tried a few vite configurations from github
1.
optimizeDeps: {
include: ['@walletconnect/*']
},
- optimizeDeps: { exclude: ['@walletconnect/*'] },
3
build: {
commonjsOptions: {exclude: ['@walletconnect*'], include: []},
},
I do not know anything else to do, but if you have come across this issue or something similar. Please let me know how you solved yours.
Thank you.