Skip to content
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

Workaround for Vite dev dynamic import of CoinbaseWalletSDK introduced in PR #473 is needed again #3586

Closed
1 task done
wonu opened this issue Feb 10, 2024 · 3 comments · Fixed by #3591
Closed
1 task done

Comments

@wonu
Copy link

wonu commented Feb 10, 2024

Describe the bug

Issue #383's problem has resurfaced since commit 895f28e.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/vitejs-vite-jxnjko

Steps To Reproduce

  1. https://vite.new/react-ts (StackBlitz with Vite react-ts template)
  2. npm install wagmi viem@2.x @tanstack/react-query
  3. default setup as docs says
  4. TypeError: CoinbaseWalletSDK is not a constructor occurs in console and the button is unresponsive.

If install wagmi@2.5.5 instead latest(2.5.6) it works well. (except that it requires click the button twice..)

Wagmi Version

2.5.6

Viem Version

2.7.8

TypeScript Version

5.2.2

Check existing issues

Anything else?

No response

@chybisov
Copy link
Contributor

We also experience this issue. Also, when there is an error TypeError: CoinbaseWalletSDK is not a constructor, reconnect functionality stops working because when we iterate through the connectors and we have an error, there is no catch block to handle it.

image

https://github.com/wevm/wagmi/blob/main/packages/core/src/actions/reconnect.ts#L68

@enesozturk
Copy link

+1 confirming that having the same error with wagmi@2.5.6 but not with wagmi@2.5.5.

Stack trace:

Uncaught (in promise) TypeError: CoinbaseWalletSDK is not a constructor
    at Object.getProvider (@web3modal_wagmi.js?v=e91df78f:148:15)
    at async reconnect (chunk-SA6P325H.js?v=15838233:2350:23)
    getProvider                 @ @web3modal wagmi. js?v=e91df78f: 148
    await in getProvider (async)
    onMount                     @ chunk-SA6P325H.js?v=15838233:2890
    Hydrate                     @ wagmi.js?v=ac9173bf:296
    renderWithHooks             @ react-dom client.js?v=ff4dfOda:19183
    mountIndeterminateComponent @ react-dom client.js?v=ff4df0da: 21912

tmm added a commit that referenced this issue Feb 12, 2024
@tmm tmm closed this as completed in #3591 Feb 12, 2024
tmm added a commit that referenced this issue Feb 12, 2024
Copy link
Contributor

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.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants