Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Browserify - Uncaught TypeError: soljson.cwrap is not a function #125

Closed
Janaka-Steph opened this issue Jul 24, 2017 · 4 comments
Closed

Comments

@Janaka-Steph
Copy link

Hello,

I use browserify in order to use solc in the browser.
I have the most simple setup and run the most simple command browserify index.js -o bundle.js.

I have this error:

Uncaught TypeError: soljson.cwrap is not a function
    at setupMethods (bundle.js:9753)
    at Object.39../soljson.js (bundle.js:9599)
    at s (bundle.js:1)
    at bundle.js:1
    at Object.1.solc (bundle.js:3)
    at s (bundle.js:1)
    at e (bundle.js:1)
    at bundle.js:1
@axic
Copy link
Member

axic commented Jul 24, 2017

It is very likely not possible, but at least not practical, to browserify index.js, because that will load an Emscripten compiled Solidity of around 10Mb size. Instead, browserifiy wrapper.js, load a Solidity compiler (ones found in the solc-bin repo) and pass it to the wrapper.

@Janaka-Steph
Copy link
Author

A little doc about it would be nice

@axic
Copy link
Member

axic commented Jul 25, 2017

I was able to browserify it with the above command though, are you sure you have downloaded soljson.js before browserifying?`

Run npm run prepublish.

@axic
Copy link
Member

axic commented Jul 25, 2017

Can we migrate the discussion to #31?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants