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

Bug: Stackblitz (WebContainers): Uncaught TypeError: Class extends value undefined is not a constructor or null #1087

Open
scscgit opened this issue Nov 25, 2023 · 1 comment
Labels
type: bug Something isn't working

Comments

@scscgit
Copy link

scscgit commented Nov 25, 2023

Describe the bug

Stackblitz (WebContainers): Uncaught TypeError: Class extends value undefined is not a constructor or null

Steps

Repro: https://stackblitz.com/edit/nuxt-examples-bpefu2?file=app.vue

  1. Create a Stackblitz (WebContainers) project. In this case, it's a Nuxt 3 project with disabled server side rendering. (Stackblitz requires browser configuration for "Sites that can always use cookies".)
  2. Install "@coinbase/wallet-sdk": "^3.9.0" or older version
  3. In script file (<script setup> in app.vue), import CoinbaseWalletSDK from "@coinbase/wallet-sdk";

Actual behavior: error at @coinbase_wallet-sdk.js?v=75fb9835:14925, it doesn't matter if the browser extension is installed.

Uncaught TypeError: Class extends value undefined is not a constructor or null
    at node_modules/@metamask/safe-event-emitter/index.js (@coinbase_wallet-sdk.js?v=75fb9835:14925:51)
    at __require (chunk-CF3WPAMV.js?v=75fb9835:9:50)
    at node_modules/eth-block-tracker/dist/BaseBlockTracker.js (@coinbase_wallet-sdk.js?v=75fb9835:14975:49)
    at __require (chunk-CF3WPAMV.js?v=75fb9835:9:50)
    at node_modules/eth-block-tracker/dist/PollingBlockTracker.js (@coinbase_wallet-sdk.js?v=75fb9835:19732:30)
    at __require (chunk-CF3WPAMV.js?v=75fb9835:9:50)
    at node_modules/eth-block-tracker/dist/index.js (@coinbase_wallet-sdk.js?v=75fb9835:19912:19)
    at __require (chunk-CF3WPAMV.js?v=75fb9835:9:50)
    at node_modules/@coinbase/wallet-sdk/dist/provider/SubscriptionManager.js (@coinbase_wallet-sdk.js?v=75fb9835:22633:31)
    at __require (chunk-CF3WPAMV.js?v=75fb9835:9:50)

Expected behavior

Library should work in Stackblitz. Preferably, an example could be added under https://docs.cloud.coinbase.com/wallet-sdk/docs/sample-applications in addition to CodeSandbox, which is less accessible (e.g. even requires a registration to edit files, plus can be difficult to run commands).

Version

3.9.0

Additional info

No response

Desktop

OS: Windows 10
Browser: Google Chrome: 118.0.5993.117

Smartphone

No response

@scscgit scscgit added the type: bug Something isn't working label Nov 25, 2023
@GuillermoBlasco
Copy link

Went to this error as well.

Found this issue that looked similar: vitejs/vite#9703

And this worked: vitejs/vite#9703 (comment)

npm i events

Doing vite+svelte. Not sure if what solved my issue may solve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Development

No branches or pull requests

2 participants