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

Compile error: Module not found '@ledgerhq/devices/hid-framing' #499

Closed
dFohlen opened this issue Aug 3, 2022 · 4 comments · Fixed by saber-hq/saber-common#706
Closed

Comments

@dFohlen
Copy link

dFohlen commented Aug 3, 2022

Describe the bug
Compiling React app fails due to Ledger dependencies. A module named '@ledgerhq/devices/hid-framing' is not found.

To Reproduce
Steps to reproduce the behavior:

  1. Create test React app
  2. Add Solana-Wallet-Adapter as described in the Readme.md
  3. Compile error yarn build:
    yarn run v1.22.19
    $ react-scripts build
    Creating an optimized production build...
    Failed to compile.
    
    ./node_modules/@ledgerhq/hw-transport-webhid/lib-es/TransportWebHID.js
    Cannot find module: '@ledgerhq/devices/hid-framing'. Make sure this package is installed.
    
    You can install this package by running: yarn add @ledgerhq/devices/hid-framing.
    
    
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    

Expected behavior
The React app should compile without any errors. The Ledger dependency has been moved because, yarn add @ledgerhq/devices/hid-framing turn also into an error:

yarn add v1.22.19
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@ledgerhq%2fdevices/hid-framing: Request \"https://registry.yarnpkg.com/@ledgerhq%2fdevices/hid-framing\" returned a 405".
info If you think this is a bug, please open a bug report with the information provided in "/Users/volker/Projekte/solana/nft-geocaching/react-app/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Screenshots
Bildschirmfoto 2022-08-03 um 17 53 32

Additional context
package.json:

 "dependencies": {
    "@solana-mobile/wallet-adapter-mobile": "^0.0.1-alpha.8",
    "@solana/spl-token": "^0.2.0",
    "@solana/wallet-adapter-base": "^0.9.9",
    "@solana/wallet-adapter-react": "^0.15.8",
    "@solana/wallet-adapter-react-ui": "^0.9.11",
    "@solana/wallet-adapter-wallets": "^0.17.0",
    "@types/react": "^18.0.0",
    "react": "^18.2.0",
    "react-dom": "^18.1.0",
    "react-range": "^1.8.12",
    "react-router-dom": "^6.3.0",
    "react-scripts": "^4.0.3",
    "typescript": "^4.5.5"
 }
@dFohlen
Copy link
Author

dFohlen commented Aug 3, 2022

Edit: Is already addressed to Ledger: LedgerHQ/ledger-live#763

@jordaaash
Copy link
Collaborator

Based on LedgerHQ/ledger-live#763 (comment) and subsequent comments it sounds like this is a problem with your build tool. I see you're using react-scripts (aka CRA) 4, which uses Webpack 4, leading to this issue. This is not supported (CRA 5 is required, along with react-app-rewired). Check out the CRA 5 starter project.

@jordaaash jordaaash reopened this Aug 4, 2022
@jordaaash
Copy link
Collaborator

Getting some other reports of this happening, reopened

@jordaaash
Copy link
Collaborator

This appears to be an issue with the latest release of the dependencies, see LedgerHQ/ledger-live#763 (comment)

Will fix this by pinning the previous version.

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 a pull request may close this issue.

2 participants