mymonero-core-js: Failed to minify the code (during npm run build -- in a Electron/React app)

We have an Electron app that is boot-strapped using create-react-app.

After referencing this module, the app will not compile anymore:

Failed to compile.

Failed to minify the code from this file: 

 	./node_modules/mymonero-core-js/monero_utils/monero_wallet_utils.js:41 

From react’s documentation:

You may occasionally find a package you depend on needs compiled or ships code for a non-browser environment.
This is considered poor practice in the ecosystem and does not have an escape hatch in Create React App.

To resolve this:

Open an issue on the dependency's issue tracker and ask that the package be published pre-compiled (retaining ES6 Modules).

Is this something that you guys could help us out with?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 18 (11 by maintainers)

Most upvoted comments

For the moment, if you want to, you can get rid of that exception by removing the override of Math.random from cryptonote_utils/cryptonote_utils.js. The reason it’s in there is to prevent emscripten from using Math.random as a source of entropy in case it’s being run in an environment that doesn’t have window.crypto/crypto nor require('crypto'). But it’s not really a solution imo.