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

Interop issue with coinbase-adapter #1967

Open
sgraphics opened this issue Sep 29, 2024 · 0 comments
Open

Interop issue with coinbase-adapter #1967

sgraphics opened this issue Sep 29, 2024 · 0 comments

Comments

@sgraphics
Copy link

Describe the bug

Cannot import coinbase-adapter as es module. Due to error "i is not a constructor"
Apparently coinbase-adapter is doing import i from "@coinbase/wallet-sdk" but "i is not a constructor".

To Reproduce

Reference coinbaseAdapter: https://unpkg.com/@web3auth/[email protected]/dist/lib.cjs/coinbaseAdapter.js

Load the library and call init():

  <script type="module">
    import { CoinbaseAdapter } from "@web3auth/coinbase-adapter";
    const adapter = new CoinbaseAdapter({ clientId : "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ" }); //taken from https://web3auth.io/docs/sdk/pnp/web/adapters/coinbase#helper-sdks-menu example
    await adapter.init(); //Error here!!
  </script>

Expected behavior

No error

Additional context

Issue and potential solution described in more detail here: jspm/project#344 (comment)

Current code:

var CoinbaseWalletSDK = require('@coinbase/wallet-sdk');

// later on

new CoinbaseWalletSDK(...)

Should instead be:

var { CoinbaseWalletSDK } = require('@coinbase/wallet-sdk');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant