Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

Commit

Permalink
fix: import EthereumProvider instead of default (#382)
Browse files Browse the repository at this point in the history
* fix: import EthereumProvider instead of default

* Update violet-days-arrive.md

---------

Co-authored-by: jxom <[email protected]>
  • Loading branch information
oxSaturn and jxom committed Jul 3, 2023
1 parent 97dbd44 commit ff53857
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/violet-days-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wagmi/connectors": patch
---

Fixed issue importing `EthereumProvider` in Vite environments.
7 changes: 2 additions & 5 deletions packages/connectors/src/walletConnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,8 @@ export class WalletConnectConnector extends Connector<
}

async #initProvider() {
const {
default: EthereumProvider,
OPTIONAL_EVENTS,
OPTIONAL_METHODS,
} = await import('@walletconnect/ethereum-provider')
const { EthereumProvider, OPTIONAL_EVENTS, OPTIONAL_METHODS } =
await import('@walletconnect/ethereum-provider')
const [defaultChain, ...optionalChains] = this.chains.map(({ id }) => id)
if (defaultChain) {
const {
Expand Down

0 comments on commit ff53857

Please sign in to comment.