multiversx / mx-delegation-dapp

6 stars 47 forks source link

Cannot find module: '@ledgerhq/devices/hid-framing'. Make sure this package is installed. #24

Closed ovidiupurice closed 1 year ago

ovidiupurice commented 1 year ago

Hey! We got this error and have no idea how to fix it.

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.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @multiversx/template-template-dapp@2.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @multiversx/template-template-dapp@2.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2023-08-01T06_48_16_202Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @multiversx/template-template-dapp@2.1.0 build-mainnet: `npm run copy-mainnet-config & npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @multiversx/template-template-dapp@2.1.0 build-mainnet script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2023-08-01T06_48_16_239Z-debug.log
CiprianDraghici commented 1 year ago

Hey! We got this error and have no idea how to fix it.

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.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @multiversx/template-template-dapp@2.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @multiversx/template-template-dapp@2.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2023-08-01T06_48_16_202Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @multiversx/template-template-dapp@2.1.0 build-mainnet: `npm run copy-mainnet-config & npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @multiversx/template-template-dapp@2.1.0 build-mainnet script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2023-08-01T06_48_16_239Z-debug.log

Hello,

There are some solutions for this error:

  1. Upgrade to react-scripts 5
  2. Use react-app-rewired or @craco instead of react-scripts 4
  3. Use another build system: eg. Vite
  4. Use yarn for installing packages and put this code snippet in your package.json
    "resolutions": {
    "@ledgerhq/hw-transport-webhid": "6.27.1",
    "@ledgerhq/hw-transport-webusb": "6.27.1"
    }

My recommendation is to use any of the points: 1 - 3

CiprianDraghici commented 1 year ago

Closed due to inactivity

MiroMargineanu commented 1 year ago

Hello @ovidiupurice!

We've now upgraded the Delegation Dashboard to the 2.3.0 version which is run on a new build setup (Vite). This new approach should be more friendly towards platform compatibility. Make sure that you've got the latest build running. Also, please let me know if this issue persists. 🙏