Closed Kori000 closed 1 month ago
If this is a fix can it be merged already? 🤲🙏
How to solve this problem?
How to solve this problem?
Adding this to your package.json is a work around.
"overrides": { "@ledgerhq/errors": "6.16.3" }
@Devonthib
"overrides": {
"@ledgerhq/errors": "6.16.3"
}
I tried using that version, but I'm still encountering the same error.
ERROR in ./node_modules/@solana/wallet-adapter-ledger/node_modules/@ledgerhq/hw-transport/lib-es/Transport.js 225:26-48
How to solve this problem?
Adding this to your package.json is a work around.
"overrides": { "@ledgerhq/errors": "6.16.3" }
I'm using yarn and added resolutions but not working.
I have the same problem. Have you found a solution?
Still does not work . . .
Still does not work . . . when to merge this PR。
How to solve this problem?
Adding this to your package.json is a work around. "overrides": { "@ledgerhq/errors": "6.16.3" }
I'm using yarn and added resolutions but not working
rm -rf node_modules
npm i --force
npm -i force
AND
pnpm -i force
doesn't work, or I get missing modules:
ERROR in ./src/App.tsx 5:0-67
Module not found: Error: Can't resolve '@solana/wallet-adapter-base' in '/home/candid/wallet-adapter/packages/starter/create-react-app-starter/src'
ERROR in ./src/App.tsx 6:0-82
Module not found: Error: Can't resolve '@solana/wallet-adapter-react' in '/home/candid/wallet-adapter/packages/starter/create-react-app-starter/src'
ERROR in ./src/App.tsx 7:0-89
Module not found: Error: Can't resolve '@solana/wallet-adapter-react-ui' in '/home/candid/wallet-adapter/packages/starter/create-react-app-starter/src'
ERROR in ./src/App.tsx 8:0-75
Module not found: Error: Can't resolve '@solana/wallet-adapter-wallets' in '/home/candid/wallet-adapter/packages/starter/create-react-app-starter/src'
These modules aren't missing when I use yarn.
I am trying to get this working: https://github.com/anza-xyz/wallet-adapter/tree/master/packages/starter/create-react-app-starter
Edit: Also I need to add "@ledgerhq/errors": "6.16.3" to my dependencies too right?
npm -i force
AND
pnpm -i force
doesn't work, or I get missing modules:
ERROR in ./src/App.tsx 5:0-67 Module not found: Error: Can't resolve '@solana/wallet-adapter-base' in '/home/candid/wallet-adapter/packages/starter/create-react-app-starter/src' ERROR in ./src/App.tsx 6:0-82 Module not found: Error: Can't resolve '@solana/wallet-adapter-react' in '/home/candid/wallet-adapter/packages/starter/create-react-app-starter/src' ERROR in ./src/App.tsx 7:0-89 Module not found: Error: Can't resolve '@solana/wallet-adapter-react-ui' in '/home/candid/wallet-adapter/packages/starter/create-react-app-starter/src' ERROR in ./src/App.tsx 8:0-75 Module not found: Error: Can't resolve '@solana/wallet-adapter-wallets' in '/home/candid/wallet-adapter/packages/starter/create-react-app-starter/src'
These modules aren't missing when I use yarn.
I am trying to get this working: https://github.com/anza-xyz/wallet-adapter/tree/master/packages/starter/create-react-app-starter
Edit: Also I need to add "@ledgerhq/errors": "6.16.3" to my dependencies too right?
npm -i force ❌
npm i --force ✅
npm i --force results in:
npm WARN using --force Recommended protections disabled.
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:^
npm ERR! A complete log of this run can be found in: /home/candid/.npm/_logs/2024-05-07T20_50_44_378Z-debug-0.log
pnpm i --force results in:
Failed to compile.
Module not found: Error: Can't resolve '@solana/wallet-adapter-base' in '/home/candid/wallet-adapter/packages/starter/create-react-app-starter/src'
ERROR in ./src/App.tsx 5:0-67
Module not found: Error: Can't resolve '@solana/wallet-adapter-base' in '/home/candid/wallet-adapter/packages/starter/create-react-app-starter/src'
ERROR in ./src/App.tsx 6:0-82
Module not found: Error: Can't resolve '@solana/wallet-adapter-react' in '/home/candid/wallet-adapter/packages/starter/create-react-app-starter/src'
ERROR in ./src/App.tsx 7:0-89
Module not found: Error: Can't resolve '@solana/wallet-adapter-react-ui' in '/home/candid/wallet-adapter/packages/starter/create-react-app-starter/src'
ERROR in ./src/App.tsx 8:0-75
Module not found: Error: Can't resolve '@solana/wallet-adapter-wallets' in '/home/candid/wallet-adapter/packages/starter/create-react-app-starter/src'
webpack compiled with 4 errors
ERROR in src/App.tsx:1:38
TS2307: Cannot find module '@solana/wallet-adapter-base' or its corresponding type declarations.
> 1 | import { WalletAdapterNetwork } from '@solana/wallet-adapter-base';
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | import { ConnectionProvider, WalletProvider } from '@solana/wallet-adapter-react';
3 | import { WalletModalProvider, WalletMultiButton } from '@solana/wallet-adapter-react-ui';
4 | import { UnsafeBurnerWalletAdapter } from '@solana/wallet-adapter-wallets';
ERROR in src/App.tsx:2:52
TS2307: Cannot find module '@solana/wallet-adapter-react' or its corresponding type declarations.
1 | import { WalletAdapterNetwork } from '@solana/wallet-adapter-base';
> 2 | import { ConnectionProvider, WalletProvider } from '@solana/wallet-adapter-react';
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 | import { WalletModalProvider, WalletMultiButton } from '@solana/wallet-adapter-react-ui';
4 | import { UnsafeBurnerWalletAdapter } from '@solana/wallet-adapter-wallets';
5 | import { clusterApiUrl } from '@solana/web3.js';
ERROR in src/App.tsx:3:56
TS2307: Cannot find module '@solana/wallet-adapter-react-ui' or its corresponding type declarations.
1 | import { WalletAdapterNetwork } from '@solana/wallet-adapter-base';
2 | import { ConnectionProvider, WalletProvider } from '@solana/wallet-adapter-react';
> 3 | import { WalletModalProvider, WalletMultiButton } from '@solana/wallet-adapter-react-ui';
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 | import { UnsafeBurnerWalletAdapter } from '@solana/wallet-adapter-wallets';
5 | import { clusterApiUrl } from '@solana/web3.js';
6 | import React, { FC, ReactNode, useMemo } from 'react';
ERROR in src/App.tsx:4:43
TS2307: Cannot find module '@solana/wallet-adapter-wallets' or its corresponding type declarations.
2 | import { ConnectionProvider, WalletProvider } from '@solana/wallet-adapter-react';
3 | import { WalletModalProvider, WalletMultiButton } from '@solana/wallet-adapter-react-ui';
> 4 | import { UnsafeBurnerWalletAdapter } from '@solana/wallet-adapter-wallets';
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5 | import { clusterApiUrl } from '@solana/web3.js';
6 | import React, { FC, ReactNode, useMemo } from 'react';
7 |
I am trying to get this working: https://github.com/anza-xyz/wallet-adapter/tree/master/packages/starter/create-react-app-starter.
I have been trying to get this to work for the past 10 days. I had a smooth time cross compiling the Solana program into bytecode, but I am really struggling on the frontend side. The react template is completely broken and the person who renamed TransportRaceCondition did not help.
Do you have any solution?
If not then I am thinking of using Yarn because it actually installs the missing dependencies instead of skipping them and then going into transport.js and changing the function being called from TransportRaceCondition to TransportPendingOperation. What do you think?
I am still getting the error:
ERROR in ./node_modules/@ledgerhq/hw-transport/lib-es/Transport.js 225:26-48
export 'TransportRaceCondition' (imported as 'TransportRaceCondition') was not found in '@ledgerhq/errors'
Even if I replace the TransportRaceCondition import as TransportPendingOperation in transport.js. Not sure what I am missing here.
Hmmm I have been digging deeper. I renamed TransportRaceCondition to TransportPendingOperation in both transport.js, transport.ts, and transport.js.flow and everywhere it is associated in @ledgerhq and I am still having this compile error. Why does it keep giving me this error even though I changed the function call?
@Kori000 I am having the same problem as @gameuser1982 and others. Can you possibly assist? What kind of god damned idiot decided to rename TransportRaceCondition to TransportPendingOperation? It creates so much trouble!
For temporarily fix, add below line into file node_modules/@ledgerhq/hw-transport/node_modules/@ledgerhq/errors/lib-es/index.js
export const TransportRaceCondition = createCustomErrorClass("TransportPendingOperation");
npm i --force results in:
npm WARN using --force Recommended protections disabled. npm ERR! code EUNSUPPORTEDPROTOCOL npm ERR! Unsupported URL Type "workspace:": workspace:^ npm ERR! A complete log of this run can be found in: /home/candid/.npm/_logs/2024-05-07T20_50_44_378Z-debug-0.log
pnpm i --force results in:
Failed to compile. Module not found: Error: Can't resolve '@solana/wallet-adapter-base' in '/home/candid/wallet-adapter/packages/starter/create-react-app-starter/src' ERROR in ./src/App.tsx 5:0-67 Module not found: Error: Can't resolve '@solana/wallet-adapter-base' in '/home/candid/wallet-adapter/packages/starter/create-react-app-starter/src' ERROR in ./src/App.tsx 6:0-82 Module not found: Error: Can't resolve '@solana/wallet-adapter-react' in '/home/candid/wallet-adapter/packages/starter/create-react-app-starter/src' ERROR in ./src/App.tsx 7:0-89 Module not found: Error: Can't resolve '@solana/wallet-adapter-react-ui' in '/home/candid/wallet-adapter/packages/starter/create-react-app-starter/src' ERROR in ./src/App.tsx 8:0-75 Module not found: Error: Can't resolve '@solana/wallet-adapter-wallets' in '/home/candid/wallet-adapter/packages/starter/create-react-app-starter/src' webpack compiled with 4 errors ERROR in src/App.tsx:1:38 TS2307: Cannot find module '@solana/wallet-adapter-base' or its corresponding type declarations. > 1 | import { WalletAdapterNetwork } from '@solana/wallet-adapter-base'; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | import { ConnectionProvider, WalletProvider } from '@solana/wallet-adapter-react'; 3 | import { WalletModalProvider, WalletMultiButton } from '@solana/wallet-adapter-react-ui'; 4 | import { UnsafeBurnerWalletAdapter } from '@solana/wallet-adapter-wallets'; ERROR in src/App.tsx:2:52 TS2307: Cannot find module '@solana/wallet-adapter-react' or its corresponding type declarations. 1 | import { WalletAdapterNetwork } from '@solana/wallet-adapter-base'; > 2 | import { ConnectionProvider, WalletProvider } from '@solana/wallet-adapter-react'; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 | import { WalletModalProvider, WalletMultiButton } from '@solana/wallet-adapter-react-ui'; 4 | import { UnsafeBurnerWalletAdapter } from '@solana/wallet-adapter-wallets'; 5 | import { clusterApiUrl } from '@solana/web3.js'; ERROR in src/App.tsx:3:56 TS2307: Cannot find module '@solana/wallet-adapter-react-ui' or its corresponding type declarations. 1 | import { WalletAdapterNetwork } from '@solana/wallet-adapter-base'; 2 | import { ConnectionProvider, WalletProvider } from '@solana/wallet-adapter-react'; > 3 | import { WalletModalProvider, WalletMultiButton } from '@solana/wallet-adapter-react-ui'; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | import { UnsafeBurnerWalletAdapter } from '@solana/wallet-adapter-wallets'; 5 | import { clusterApiUrl } from '@solana/web3.js'; 6 | import React, { FC, ReactNode, useMemo } from 'react'; ERROR in src/App.tsx:4:43 TS2307: Cannot find module '@solana/wallet-adapter-wallets' or its corresponding type declarations. 2 | import { ConnectionProvider, WalletProvider } from '@solana/wallet-adapter-react'; 3 | import { WalletModalProvider, WalletMultiButton } from '@solana/wallet-adapter-react-ui'; > 4 | import { UnsafeBurnerWalletAdapter } from '@solana/wallet-adapter-wallets'; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 5 | import { clusterApiUrl } from '@solana/web3.js'; 6 | import React, { FC, ReactNode, useMemo } from 'react'; 7 |
I am trying to get this working: https://github.com/anza-xyz/wallet-adapter/tree/master/packages/starter/create-react-app-starter.
I have been trying to get this to work for the past 10 days. I had a smooth time cross compiling the Solana program into bytecode, but I am really struggling on the frontend side. The react template is completely broken and the person who renamed TransportRaceCondition did not help.
Do you have any solution?
If not then I am thinking of using Yarn because it actually installs the missing dependencies instead of skipping them and then going into transport.js and changing the function being called from TransportRaceCondition to TransportPendingOperation. What do you think?
This seems to be a monorepo issue. If you want to use https://github.com/anza-xyz/wallet-adapter/tree/master/packages/starter/create-react-app-starter, you need to follow the BUILD.md instructions to start the project. Also, this project uses pnpm, so you can't use yarn.
If you're using Vite, here's a Vite template I've created that works with both npm and pnpm. However, using yarn may cause some issues, which I'll address below.
Regarding this Vite template, yarn v1 only accepts resolutions instead of overrides. When I added the following to package.json:
"resolutions": {
"@ledgerhq/errors": "6.16.3"
}
After removing node_modules and any lock files, and completing yarn install, starting the project still throws the following error:
export 'TransportRaceCondition' (imported as 'TransportRaceCondition') was not found in '@ledgerhq/errors'
When I removed the resolutions section from package.json and ran yarn install again, the project ran successfully.
This is a peculiar issue, so I suggest using npm, pnpm, or bun as package managers. If someone can resolve this issue with yarn, then I'd recommend using yarn."
Is there any ETA for this fix to be reviewed and approved for merger if it successfully passes?
seriously, FIX THIS
I'm getting the same problem, and already try did all the steps here. I'm writing to update the community still had the issue.
seriously, FIX THIS
For temporarily fix, add below line into file
node_modules/@ledgerhq/hw-transport/node_modules/@ledgerhq/errors/lib-es/index.js
export const TransportRaceCondition = createCustomErrorClass("TransportPendingOperation");
This ended up working as a temp fix
Just .... wow. I got nothing good to say ... Incompetent
Any updates on this... huge headache for the past 4 weeks this has been
Merged and updated the lockfile in 8748ff507b61eaf65e06439fe4bc5fb27e48f70c. Please let me know if this fixes the issue for you!
@jordaaash I still get this error.
I've installed the latest version and it's 0.19.32.
Is this version involved your updates? If so, when are you going to release updated version? Help me, please. I urgently need.
@fulldev100 can you link to a repo with code where you have the issue? We can't see from the screenshot where it occurs.
For temporarily fix, add below line into file
node_modules/@ledgerhq/hw-transport/node_modules/@ledgerhq/errors/lib-es/index.js
export const TransportRaceCondition = createCustomErrorClass("TransportPendingOperation");
@linuxhjkaru Working as a temporary fix for now. Thankyou so much for your help.
still getting the same issue export 'TransportRaceCondition' (imported as 'TransportRaceCondition') was not found in '@ledgerhq/errors'
@fulldev100 can you link to a repo with code where you have the issue? We can't see from the screenshot where it occurs.
it occurs as soon as i write import * as walletAdapterWallets from "@solana/wallet-adapter-wallets";
if i comment this line, everything works fine
ok this worked for me
remove node_modules
remove any lock file
add the following in package.json
"overrides": { "@ledgerhq/errors": "6.16.3" }
run npm i --force
But still Please fix this issue ASAP! so i can use it with yarn without any errors
@sponge-babe Please can you provide a repo demonstrating this issue? We haven't been able to reproduce it and we're not sure why you and others are seeing it and we're not.
I've created a new NextJS app using only npm, added wallet-adapter and the Ledger wallet (using import * from @solana/wallet-adapter-wallets
), no overrides etc, and I'm not seeing this issue.
Here's my repo, with step-by-step instructions of what I did: https://github.com/mcintyre94/wallet-adapter-ledger-test
And here's a deployed version where you should be able to connect a ledger wallet (all it has is the multi button): https://ledger-test-grecdvccf-callum-mcintyres-projects.vercel.app
We'd like to help understand and fix this issue, but we need a repo where it's happening because we can't reproduce it ourselves.
@sponge-babe Please can you provide a repo demonstrating this issue? We haven't been able to reproduce it and we're not sure why you and others are seeing it and we're not.
I've created a new NextJS app using only npm, added wallet-adapter and the Ledger wallet (using
import * from @solana/wallet-adapter-wallets
), no overrides etc, and I'm not seeing this issue.Here's my repo, with step-by-step instructions of what I did: https://github.com/mcintyre94/wallet-adapter-ledger-test
And here's a deployed version where you should be able to connect a ledger wallet (all it has is the multi button): https://ledger-test-grecdvccf-callum-mcintyres-projects.vercel.app
We'd like to help understand and fix this issue, but we need a repo where it's happening because we can't reproduce it ourselves.
There you go @mcintyre94 , Ledger-hq-issue-repo
use yarn
and my node version is 18.17.1
Happy debugging
Thanks, I can repro with yarn & yarn start
in that repo.
Moving discussion to https://github.com/anza-xyz/wallet-adapter/issues/950#issuecomment-2139360916 which is an open issue instead of this closed PR
ok this worked for me
- remove node_modules
- remove any lock file
- add the following in package.json
"overrides": { "@ledgerhq/errors": "6.16.3" }
- run
npm i --force
But still Please fix this issue ASAP! so i can use it with yarn without any errors
I got a new error in the browser
Uncaught TypeError: Class extends value /static/media/client.98866d6736d9f36d61b8.cjs is not a constructor or null at ./node_modules/@solana/web3.js/lib/index.browser.esm.js (rpc-websocket.ts:16:1) at options.factory (react refresh:6:1) at webpack_require__ (bootstrap:22:1) at fn (hot module replacement:61:1) at ./node_modules/@solana/wallet-adapter-react/lib/esm/ConnectionProvider.js (useWalletModal.tsx:36:1) at options.factory (react refresh:6:1) at webpack_require__ (bootstrap:22:1) at fn (hot module replacement:61:1) at ./src/App.tsx (bundle.js:16:86) at options.factory (react refresh:6:1)
@yinchonging Same issue, this project/repo is plagued with issues
Thanks, everyone. Please move relevant discussion to #950.
https://github.com/LedgerHQ/ledger-live/commit/931d511f5c5da86ddee53c69775515da019b6241
Expaned view
``` npm why @ledgerhq/errors @ledgerhq/errors@6.16.4 node_modules/@ledgerhq/errors @ledgerhq/errors@"^6.10.0" from @ledgerhq/devices@6.27.1 node_modules/@ledgerhq/devices @ledgerhq/devices@"^6.27.1" from @ledgerhq/hw-transport@6.27.1 node_modules/@ledgerhq/hw-transport @ledgerhq/hw-transport@"^6.27.1" from @ledgerhq/hw-transport-webhid@6.27.1 node_modules/@ledgerhq/hw-transport-webhid @ledgerhq/hw-transport-webhid@"6.27.1" from @solana/wallet-adapter-ledger@0.9.25 node_modules/@solana/wallet-adapter-ledger @solana/wallet-adapter-ledger@"^0.9.25" from @solana/wallet-adapter-wallets@0.19.32 node_modules/@solana/wallet-adapter-wallets @solana/wallet-adapter-wallets@"^0.19.32" from the root project @ledgerhq/hw-transport@"6.27.1" from @solana/wallet-adapter-ledger@0.9.25 node_modules/@solana/wallet-adapter-ledger @solana/wallet-adapter-ledger@"^0.9.25" from @solana/wallet-adapter-wallets@0.19.32 node_modules/@solana/wallet-adapter-wallets @solana/wallet-adapter-wallets@"^0.19.32" from the root project @ledgerhq/devices@"^6.27.1" from @ledgerhq/hw-transport-webhid@6.27.1 node_modules/@ledgerhq/hw-transport-webhid @ledgerhq/hw-transport-webhid@"6.27.1" from @solana/wallet-adapter-ledger@0.9.25 node_modules/@solana/wallet-adapter-ledger @solana/wallet-adapter-ledger@"^0.9.25" from @solana/wallet-adapter-wallets@0.19.32 node_modules/@solana/wallet-adapter-wallets @solana/wallet-adapter-wallets@"^0.19.32" from the root project @ledgerhq/devices@"6.27.1" from @solana/wallet-adapter-ledger@0.9.25 node_modules/@solana/wallet-adapter-ledger @solana/wallet-adapter-ledger@"^0.9.25" from @solana/wallet-adapter-wallets@0.19.32 node_modules/@solana/wallet-adapter-wallets @solana/wallet-adapter-wallets@"^0.19.32" from the root project @ledgerhq/errors@"^6.10.0" from @ledgerhq/hw-transport@6.27.1 node_modules/@ledgerhq/hw-transport @ledgerhq/hw-transport@"^6.27.1" from @ledgerhq/hw-transport-webhid@6.27.1 node_modules/@ledgerhq/hw-transport-webhid @ledgerhq/hw-transport-webhid@"6.27.1" from @solana/wallet-adapter-ledger@0.9.25 node_modules/@solana/wallet-adapter-ledger @solana/wallet-adapter-ledger@"^0.9.25" from @solana/wallet-adapter-wallets@0.19.32 node_modules/@solana/wallet-adapter-wallets @solana/wallet-adapter-wallets@"^0.19.32" from the root project @ledgerhq/hw-transport@"6.27.1" from @solana/wallet-adapter-ledger@0.9.25 node_modules/@solana/wallet-adapter-ledger @solana/wallet-adapter-ledger@"^0.9.25" from @solana/wallet-adapter-wallets@0.19.32 node_modules/@solana/wallet-adapter-wallets @solana/wallet-adapter-wallets@"^0.19.32" from the root project @ledgerhq/errors@"^6.10.0" from @ledgerhq/hw-transport-webhid@6.27.1 node_modules/@ledgerhq/hw-transport-webhid @ledgerhq/hw-transport-webhid@"6.27.1" from @solana/wallet-adapter-ledger@0.9.25 node_modules/@solana/wallet-adapter-ledger @solana/wallet-adapter-ledger@"^0.9.25" from @solana/wallet-adapter-wallets@0.19.32 node_modules/@solana/wallet-adapter-wallets @solana/wallet-adapter-wallets@"^0.19.32" from the root project ```