67P / kredits-web

Kredits Web UI
https://kredits.kosmos.org
6 stars 2 forks source link

Update ethers.js to latest 4.0 version #80

Closed bumi closed 5 years ago

bumi commented 5 years ago

Ethers.js is now in version 4.0 and has some (minor) breaking changes, see migration guide

I tried to update ethers.js to the latest 4.0.0 version but then running kredits-web fails with the following error: does anyone know what that could mean? is it a problem within the ethers.js package?

kredits/kredits-web@master  » npm run start:local
npm WARN lifecycle The node binary used for scripts is /home/bumi/.nodenv/shims/node but npm is using /usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> kredits-web@1.0.0 start:local /home/bumi/src/kredits/kredits-web
> NETWORK_ID=100 WEB3_PROVIDER_URL=http://localhost:7545 ember s

WARNING: Node v10.10.0 is not tested against Ember CLI on your platform. We recommend that you use the most-recent "Active LTS" version of Node.js. See https://git.io/v7S5n for details.
Could not start watchman
Visit https://ember-cli.com/user-guide/#watchman for more info.
[BABEL] Note: The code generator has deoptimised the styling of "/home/bumi/src/kredits/kredits-web/node_modules/ethers/dist/ethers.js" as it exceeds the max of "500KB".
Build Error (CoreObject)

Cannot find module './utils/properties' from '/home/bumi/src/kredits/kredits-web/node_modules/ethers/dist'

Stack Trace and Error Report: /tmp/error.dump.cd821938fea1a848b3ce2bb5f74a4cef.log
[BABEL] Note: The code generator has deoptimised the styling of "/home/bumi/src/kredits/kredits-web/node_modules/lodash/lodash.js" as it exceeds the max of "500KB".
cleaning up...

in the log:

ERROR Summary:

  - broccoliBuilderErrorStack: Error: Cannot find module './utils/properties' from '/home/bumi/src/kredits/kredits-web/node_modules/ethers/dist'
    at /home/bumi/src/kredits/kredits-web/node_modules/ember-browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:55:21
    at load (/home/bumi/src/kredits/kredits-web/node_modules/ember-browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:69:43)
    at onex (/home/bumi/src/kredits/kredits-web/node_modules/ember-browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:92:31)
    at /home/bumi/src/kredits/kredits-web/node_modules/ember-browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:22:47
    at FSReqWrap.oncomplete (fs.js:154:21)
  - codeFrame: Cannot find module './utils/properties' from '/home/bumi/src/kredits/kredits-web/node_modules/ethers/dist'
  - errorMessage: Build Canceled: Broccoli Builder ran into an error with `CoreObject` plugin. 💥
Cannot find module './utils/properties' from '/home/bumi/src/kredits/kredits-web/node_modules/ethers/dist'

indeed there is no ./utils/properties in node_modules/ethers/dist

raucao commented 5 years ago

I think it means that either the "npm install" failed in some way, or there's an actual bug in the ethers build. It's trying to find a linked module in the dist dir, but a dist build should actually have all its code compiled into one file usually.

bumi commented 5 years ago

npm install looked fine.

raucao commented 5 years ago

I would create an issue for ethers.js then.

gregkare commented 5 years ago

This could be a problem with the Current version of Node, are you getting the same error on LTS?

galfert commented 5 years ago

I think I might have had a similar problem once, where deleting the whole node_modules directory and running npm install again fixed it.

raucao commented 5 years ago

I can confirm the same issue with the master branch of this repo, linking it to the kredits-web. It wasn't mentioned that it fails when using npm link in the original post, because just installing the module as a normal dependency works fine.

bumi commented 5 years ago

so, yep... I tried to debug it again and it seems to fail when npm linking the kredits-contracts package.

I am closing this issue and opening new ones for the update and linking issue.