I get this error from time to time when I run ghcjs on a large-ish code base (~10k LOC, lots of template haskell):
fd:40: hPutBuf: illegal operation (handle is closed)
my best bet is that this is an out-of-memory error. when i re-run the build it usually works the second or third time (probably because it can build on the partial result from the previous runs?).
now i am wondering if there is a way to give node more memory than the 1GB (i think?) that it gets by default. there is --max_old_space_size
, which i found when searching here for "increase node memory", but i haven't found a way to pass that argument to node as called from ghcjs.
thanks!
EDIT: possibly related: https://github.com/ghcjs/ghcjs/issues/601, https://github.com/ghcjs/ghcjs/issues/588