Web3.js: Failed to minify code, file : web3-core-method with [email protected]

Created on 2 Dec 2019  路  4Comments  路  Source: ChainSafe/web3.js

Expected behavior

Successful building of the node modules

Actual behavior

Failure while minifying file at ./node_modules/web3-core-method

Steps to reproduce the behavior

  1. Setup app using create-react-app & install [email protected]
  2. run npm run build

Note: On bringing down the web3 version to 1.2.0 it actually builds.

Logs

Failed to minify the code from this file:

    ./node_modules/web3-core-method/src/index.js:282

Versions

Web3 : 1.2.4
Nodejs : v10.17.0
NPM : 6.11.3
OS : Ubuntu 19.04

1.x clarification needed

Most helpful comment

Yes, below is the complete log of the run.

Error Message:

Creating an optimized production build...
Failed to compile.

Failed to minify the code from this file:

    ./node_modules/web3-core-method/src/index.js:282

Read more here: http://bit.ly/2tRViJ9

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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:

Run log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]~prebuild: [email protected]
6 info lifecycle [email protected]~build: [email protected]
7 verbose lifecycle [email protected]~build: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~build: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/my_dir/web/client/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
9 verbose lifecycle [email protected]~build: CWD: /my_dir/web/client
10 silly lifecycle [email protected]~build: Args: [ '-c', 'node scripts/build.js' ]
11 silly lifecycle [email protected]~build: Returned: code: 1 signal: null
12 info lifecycle [email protected]~build: Failed to exec build script
13 verbose stack Error: [email protected] build: node scripts/build.js
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid [email protected]
15 verbose cwd /my_dir/web/client
16 verbose Linux 5.0.0-36-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "build"
18 verbose node v10.17.0
19 verbose npm v6.11.3
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build: node scripts/build.js
22 error Exit status 1
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Version:
"webpack": "3.8.1"

All 4 comments

Thanks for opening this issue! I'm able to create a minified build with parcel and webpack with the latest version of web3.js. Could you please add the whole error message?

Yes, below is the complete log of the run.

Error Message:

Creating an optimized production build...
Failed to compile.

Failed to minify the code from this file:

    ./node_modules/web3-core-method/src/index.js:282

Read more here: http://bit.ly/2tRViJ9

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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:

Run log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]~prebuild: [email protected]
6 info lifecycle [email protected]~build: [email protected]
7 verbose lifecycle [email protected]~build: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~build: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/my_dir/web/client/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
9 verbose lifecycle [email protected]~build: CWD: /my_dir/web/client
10 silly lifecycle [email protected]~build: Args: [ '-c', 'node scripts/build.js' ]
11 silly lifecycle [email protected]~build: Returned: code: 1 signal: null
12 info lifecycle [email protected]~build: Failed to exec build script
13 verbose stack Error: [email protected] build: node scripts/build.js
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid [email protected]
15 verbose cwd /my_dir/web/client
16 verbose Linux 5.0.0-36-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "build"
18 verbose node v10.17.0
19 verbose npm v6.11.3
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build: node scripts/build.js
22 error Exit status 1
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Version:
"webpack": "3.8.1"

@rudreshsolanki97 Thanks for providing additional information! We will test and if required fix it asap.

We're seeing Web3 1.2.8 install, run a webpack production build, and execute correctly on gnosis/dex-react.

Going to close this but if someone has a simple reproduction case (e.g a repo with clear reproduction steps please just ping and will investigate further.)

Was this page helpful?
0 / 5 - 0 ratings