browser-solc
browser-solc copied to clipboard
Breaking Issue with 0.5.x?
Hi there! Been using this for an in-browser Solidity browser and but can't seem to migrate to Solidity 0.5.x. It seems to be related to this issue of import
and export
JSON for 0.5.x:
https://ethereum.stackexchange.com/questions/63267/solc-compile-0-5-0-is-not-working-like-0-4-version
Love being able to use browser-solc
as it avoids import
and would love to continue! Let me know what more details I can provide.
I had the same issue. The problem is simply that @ericxtang hasn't updated this repo since version 0.5 came out. If you go into package.json
and specify version 0.5 of solc-js, and then rebuild index.js
yourself using the command in the readme, it should work (although solc itself has changed the syntax around using it so you will have to change your code as well)
@maxwellfoley3 Thank you for this! I'm having some trouble rebuilding it after specifying the new version. After running npm install
then npm run build
, I get:
Error: Cannot find module 'solc/wrapper' from '/Users/coogan/github/browser-solc/src'
Any ideas of how to get around this?? Super appreciate it.
okay, I think that was just an install issue and think I've gotten past it. however, now I'm having issues with the adjusted file input format for 0.5.x compiler related to this SO question:
https://ethereum.stackexchange.com/questions/63267/solc-compile-0-5-0-is-not-working-like-0-4-version
@maxwellfoley3 , were you able to get your input corrected?
Hi coogan. Did you ever get compile working with the newest version of solc, 0.5.x+?
I'm getting this error:
RuntimeError: abort(Assertion failed: Cannot call unknown function compileJSON, make sure it is exported). Build with -s ASSERTIONS=1 for more info.
m browser-solc.min.js:7245
Fixed in my fork. See PR https://github.com/ericxtang/browser-solc/pull/5
I changed "compileJSON" to "solidity_compile" in one place, to accomodate the newest solcjson code compilation standards. I added a little notes. Thank you, I am your code angel~
You are indeed my code angel! Gracias.
Any other code needed to run this?
you'll need to wrap your solidity code text, as you mentioned in that SA thread. I put those notes in my repo and in the PR.
You'll need to update your parsing routine as the result JSON from the compiler has changed format a little, but you can figure that out.
So now, we need to figure out how to make it work under Chrome, and then Brave, lol.
See this Ethereum / Chrome ticket
and this Ethereum / Solc-JS ticket
and this Metamask Brave ticket