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

fix: TransportRaceCondition is not found becasue it is renamed to TransportPendingOperation #949

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Kori000
Copy link

@Kori000 Kori000 commented Apr 22, 2024

LedgerHQ/ledger-live@931d511

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

@devfive
Copy link

devfive commented Apr 23, 2024

@SpiffGreen
Copy link

If this is a fix can it be merged already? 🤲🙏

@jh-9527
Copy link

jh-9527 commented Apr 29, 2024

How to solve this problem?

@Devonthib
Copy link

How to solve this problem?

Adding this to your package.json is a work around.

"overrides": {
"@ledgerhq/errors": "6.16.3"
}

@karangoraniya
Copy link

karangoraniya commented Apr 30, 2024

@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

@wakechromium
Copy link

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.

@ArlenMor
Copy link

ArlenMor commented May 2, 2024

I have the same problem. Have you found a solution?

@lodiii
Copy link

lodiii commented May 5, 2024

Still does not work . . .

@dduo518
Copy link

dduo518 commented May 6, 2024

Still does not work . . .
when to merge this PR。

@Kori000
Copy link
Author

Kori000 commented May 7, 2024

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

Snipaste_2024-05-07_11-48-28

rm -rf node_modules
npm i --force

@gameuser1982
Copy link

gameuser1982 commented May 7, 2024

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?

@Kori000
Copy link
Author

Kori000 commented May 7, 2024

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 ✅

@gameuser1982
Copy link

gameuser1982 commented May 7, 2024

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?

@gameuser1982
Copy link

gameuser1982 commented May 8, 2024

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.

@gameuser1982
Copy link

gameuser1982 commented May 8, 2024

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?

@shinebacksoftware
Copy link

shinebacksoftware commented May 8, 2024

@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!

@linuxhjkaru
Copy link

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");

@Kori000
Copy link
Author

Kori000 commented May 9, 2024

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.

@Kori000
Copy link
Author

Kori000 commented May 9, 2024

Snipaste_2024-05-09_12-41-05

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."

@coredomain
Copy link

Is there any ETA for this fix to be reviewed and approved for merger if it successfully passes?

@keolamation
Copy link

seriously, FIX THIS

@ricardopxlcl
Copy link

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

@L-F-Escobar
Copy link

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

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

Successfully merging this pull request may close these issues.

None yet