question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to compile source greater than ~1.3MB

See original GitHub issue

When trying to compile large codebase, the below error is shown

~/node_modules/solc/soljson.js:1
(function (exports, require, module, __filename, __dirname) { var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](

RangeError: Source is too large
    at Uint8Array.set (native)
    at _emscripten_memcpy_big (/home/max/Desktop/Ethereum/polymath-core/node_modules/solc/soljson.js:1:1109281)
    at q8a (/home/max/Desktop/Ethereum/polymath-core/node_modules/solc/soljson.js:12:88915)
    at XTa (/home/max/Desktop/Ethereum/polymath-core/node_modules/solc/soljson.js:5:597290)
    at Array.ZSa (/home/max/Desktop/Ethereum/polymath-core/node_modules/solc/soljson.js:5:557122)
    at Object.eab [as dynCall_vii] (/home/max/Desktop/Ethereum/polymath-core/node_modules/solc/soljson.js:12:99737)
    at invoke_vii (/home/max/Desktop/Ethereum/polymath-core/node_modules/solc/soljson.js:1:1114761)
    at Array.ed (/home/max/Desktop/Ethereum/polymath-core/node_modules/solc/soljson.js:6:8702)
    at Object.wjb [as dynCall_viiii] (/home/max/Desktop/Ethereum/polymath-core/node_modules/solc/soljson.js:12:147059)
    at invoke_viiii (/home/max/Desktop/Ethereum/polymath-core/node_modules/solc/soljson.js:1:1121636)

The errorsome contracts can be found at https://github.com/PolymathNetwork/polymath-core/tree/compilation-bug They are huge because solidity-coverage adds tons of events to track coverage.

To make testing easier, I have added the huge source and compile script to https://github.com/maxsam4/solc-bug-sample with instructions to reproduce.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
axiccommented, Jan 17, 2019

It shouldn’t 😃

0reactions
matheusaaguiarcommented, Aug 12, 2022

Closing this for inactivity.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trying to compile from source. - Actian's Community
I'm trying to compile Ingres from source and have run into what must be an easy problem - but ... (not total -...
Read more >
Unable to install "tidyverse" package - RStudio Community
Hey, guys Been trying to install tidyverse package and I keep getting ... length 1382058 bytes (1.3 MB) downloaded 1.3 MB package 'rlang' ......
Read more >
Compile unsuccess for Out of memory - TI E2E
The source code is large. Its size is more than 3MB.I think the reason of thisproblem is that my model is too big...
Read more >
Valknut Manual
Compiling the source code. Compiling on Linux ... All of your files and settings will carry over, so don't worry about losing anything....
Read more >
Windows fails to install package from source 'tar.gz', e.g., "GO ...
EXE was started with the above path as the current directory. UNC paths are not supported. Defaulting to Windows directory.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found