Meteor 1.3 / browserify potential issue

Hi,

I am trying out the new Meteor 1.3 release (RC 13) on an existing project of ours. We were using cosmos:browserify with some packages previously. We have one package ‘ethereumjs-util’ which through it’s sub-dependencies eventually depends on ‘sha3’ …

However when I try and build this project I see the following error:

Unable to resolve some modules:

“build/Release/sha3” in
/Users/Rick/Development/meteor/meteor-1.3-testing/test/node_modules/ethereumjs-util/node_modules/keccakjs/node_modules/sha3/package.json
(web.browser)

The package.json in question has the following entry:

“main”: “build/Release/sha3”,
“scripts”: {
“install”: “node-gyp rebuild”,
“test”: “python test/generate_tests.py > test/test_vectors.js && node test/test_vectors.js && mocha test/unit_tests.js”
},

I know that the sha3 package looks to be a C++ NPM package which I wonder might cause some issues with the entry for ‘main’? Also I have removed cosmos:browserify for now. Can someone please explain how the new 1.3 release might effect the usage of browserify/npm in general?

Thanks in advance,
Rick

I can’t help with the first part but in 1.3 there’s no need for browserify anymore. You can import npm packages directly and Meteor will bundle the necessary files for the client, without any extra work on your part.

So untested but in theory:

$ npm install --save ethereumjs-util

and then ONE of these options (the last is guaranteed to work, the others depend on how ethereumjs-util exports it’s methods, I don’t recall exactly how babel handles such cases):

import eutil from 'ethereumjs-util';
import * as eutil from 'ethereumjs-util';
import { addHexPrefix, baToJSON, etc } from 'ethereumjs-util';
1 Like