Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Browserify fails when ethereumjs-block is a dependency of a dependency #39

Closed
garbados opened this issue Jan 13, 2018 · 8 comments
Closed

Comments

@garbados
Copy link

garbados commented Jan 13, 2018

When trying to browserify code that depends on ethereumjs-block, browserify fails because it cannot find the appropriate babel preset relative to the ethereumjs-block project. Removing the "browserify" section from ethereumjs-block's package.json seemed to fix the issue.

For example:

garbados@zebu:~/code/sat-home$ npm run build

> sat-home@1.0.0-alpha build /home/garbados/code/sat-home
> browserify index.js -o app.js

Error: Couldn't find preset "es2015" relative to directory "/home/garbados/code/cubesat-db/node_modules/ethereumjs-block" while parsing file: /home/garbados/code/cubesat-db/node_modules/ethereumjs-block/header.js
    at /home/garbados/code/cubesat-db/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19
    at Array.map (<anonymous>)
    at OptionManager.resolvePresets (/home/garbados/code/cubesat-db/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
    at OptionManager.mergePresets (/home/garbados/code/cubesat-db/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
    at OptionManager.mergeOptions (/home/garbados/code/cubesat-db/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
    at OptionManager.init (/home/garbados/code/cubesat-db/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at File.initOptions (/home/garbados/code/cubesat-db/node_modules/babel-core/lib/transformation/file/index.js:212:65)
    at new File (/home/garbados/code/cubesat-db/node_modules/babel-core/lib/transformation/file/index.js:135:24)
    at Pipeline.transform (/home/garbados/code/cubesat-db/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
    at Babelify._flush (/home/garbados/code/cubesat-db/node_modules/babelify/index.js:26:24)
@alanshaw
Copy link

I'm also seeing this problem

@holgerd77
Copy link
Member

Would it help switching to the env preset in our package.json (which we are doing anyhow for the various libs atm) since this is included with babel and need no path? Could someone (@garbados ?) test this?

@holgerd77
Copy link
Member

Nevermind, I did the PR above. Since the browserify section is only used by the karma test runner, I moved this from the global package.json configuration to the karma conf, this is cleaner anyway.

This should now fix your problem, shouldn't it?

@paulogr
Copy link

paulogr commented Feb 2, 2018

Hey, having the same problem here using js-ipfs.
How can I solve this on my side?

@alanshaw
Copy link

alanshaw commented Feb 2, 2018

I think the PR just needs to get merged and released...

@mitra42
Copy link

mitra42 commented Feb 15, 2018

I'm seeing this problem - its blocking updates on anything that depends on anything that depends on ethereumjs

@holgerd77
Copy link
Member

Just released v1.7.1.

@garbados
Copy link
Author

Yay! Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants