"EthereumProvider.init is not a function" #2687
-
The application is using WalletConnect v1. We are currently working on upgrading it to v2. We thought it would be a relatively straightforward task, but we encountered an error that is preventing us from proceeding. If anyone knows how to resolve this error, please let us know.
We have updated the libraries involved in the process.
Here is the code for instantiating web3modal:
When I modify the code and set We appreciate any advice or guidance you can provide. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
This error is also happening to me. |
Beta Was this translation helpful? Give feedback.
-
To whom it may concern, I have conducted an investigation, and as a conclusion, I believe this is likely a bug on the library side. Please take a look at the following code:
The expectation is that As a result, an exception When the code is changed as follows, it functions as expected:
Instead of I believe this is a bug. Will this bug be fixed soon? Or should I contact wagmi about it? |
Beta Was this translation helpful? Give feedback.
-
I have solved this issue! Conclusion: Behavior changes depending on the version of esbuild. In my project, I use esbuild for JavaScript bundling in Rails. Upon checking, I found that the version of esbuild I was using was When I changed it to the current latest version, which is Here are the results I obtained after checking with each version of esbuild:
Such errors may also occur with other JS build tools. If you are facing the same problem, please try updating the version of your JS build tool to the latest one. Thanks @glitch-txs , @siosio34 |
Beta Was this translation helpful? Give feedback.
I have solved this issue!
Conclusion: Behavior changes depending on the version of esbuild.
In my project, I use esbuild for JavaScript bundling in Rails. Upon checking, I found that the version of esbuild I was using was
0.14.36
.When I changed it to the current latest version, which is
0.18.10
, and tried again, theTypeError: EthereumProvider.init is not a function
error no longer occurred.Here are the results I obtained after checking with each version of esbuild:
Such errors may also occur with other JS build tools. If you are facing the same problem, please try updating the versio…