Skip to content

CORS issue with Ledger #1996

@charlie-kim

Description

@charlie-kim

Current Behavior

The app crashes with CORS error when I try to connect with Ledger desktop or mobile app. Connecting with ledger via Metamask works fine.

Access to fetch at 'https://proxyseg.api.live.ledger.com//v1/projects/XXX/settings' from origin 'https://YYY.xyz' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

GET https://proxyseg.api.live.ledger.com//v1/projects/XXX/settings net::ERR_FAILED 404 (Not Found)

{context: 'client'}
'User rejected'

{context: 'client'}
Error: No matching key. history: ZZZZ

Project identifier(XXX in the example above) is different from WalletConnect project ID. I am not sure where XXX is coming from. I couldn't find any concept of "project" in ledger live document.

I did set Allowed Domains in WalletConnect config. And the domain is also verified.

Expected Behavior

Sign in successfully without crash.

Steps To Reproduce

import ledgerModule from "@web3-onboard/ledger";

const ledger = ledgerModule({
  enableDebugLogs: true,
  walletConnectVersion: 2,
  requiredChains: [5],
  projectId='ABCD', // Project ID from WalletConnect
});

What package is effected by this issue?

@web3-onboard/ledger

Is this a build or a runtime issue?

Runtime

Package Version

2.5.2

Node Version

18.12.0

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

Anything else?

Mobile login also crashes.

IMG_2855

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

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