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

This library doesn't run in the browser #114

Closed
alcuadrado opened this issue May 29, 2019 · 3 comments · Fixed by #117
Closed

This library doesn't run in the browser #114

alcuadrado opened this issue May 29, 2019 · 3 comments · Fixed by #117

Comments

@alcuadrado
Copy link
Member

As reported in ethereumjs/ethereumjs-monorepo#517, this library can't run in the browser because it uses util.callbackify.

@alcuadrado
Copy link
Member Author

This library is browserifyable as is. The actual problem is in ethereumjs-vm, as karma-browserify is behaving differently than browserify.

@holgerd77
Copy link
Member

Hmm, the associated PR browserify/node-util#25 over on the browserify library has been merged, but the code from the util library doesn't seem to be integrated in the main browserify package yet, not sure why this is working?

@alcuadrado
Copy link
Member Author

This library is using another version of util, installed from npm. That's why it works when browserifying it here.

The problem is that browserify gets lost when browserifying this as a dependency. It probably has to do with the dependency having the same name as a core module. Apparently browserify is using its builtin replacement in that case, which doesn't include callbackify.

As a temporal measure, I imported the code of callbackify, tested it in the VM and everything works. I'll open a PR with that change.

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

Successfully merging a pull request may close this issue.

2 participants