Skip to content

MetaMask throws error when used via SDK via ESM (JsDelivr) #2317

Open
@paylinkprotocol

Description

@paylinkprotocol

Current Behavior

Our issue in a nutshell: When relying just on the injected wallets like this:

const wallets = [injectedModule()]

we can easily connect via chrome browser on desktop, but on smartphone, no MM is shown.

When importing the web3-onboard MM module and extending the wallets by

const wallets = [metamask, injectedModule()]

We get this Error: Uncaught (in promise) SyntaxError: The requested module '/npm/[email protected]/+esm' does not provide an export named 'EventEmitter2' (at jsdelivr-header.js:7:1)

Beside of that, my code is like the Get Started ()

Important note: I import all these libraries via ESM (jsdelivr.com, the latest versions)

Due to the fact i can connect with MM, even with smartphone, when using this Example: , is assume the reason is a misconfigured/mis-bundled ESM

Expected Behavior

It works like in the example of Blocknative

Steps To Reproduce

No response

What package is effected by this issue?

@web3-onboard/injected-wallets

Is this a build or a runtime issue?

Runtime

Package Version

the latest (2.23.0)

Node Version

No response

What browsers are you seeing the problem on?

Chrome

Relevant log output

Uncaught (in promise) SyntaxError: The requested module '/npm/[email protected]/+esm' does not provide an export named 'EventEmitter2' (at jsdelivr-header.js:7:1)

Anything else?

No response

Sanity Check

  • If this is a build issue, I have included my build config. If this is a runtime issue, I have included reproduction steps and/or a Minimal, Reproducible Example.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions