muddler
muddler copied to clipboard
[DEBUG:] Error loading output file, err: InvalidJSONInput: parse error: premature EOF
When rebuilding a project that's open in Mudlet, Mudlet shows this error message:
[DEBUG:] Error loading output file, err: InvalidJSONInput: parse error: premature EOF
(right here) ------^
at lua_yajl.c line 318
[DEBUG:] preremove cofudlet
[DEBUG:] postremove cofudlet
[DEBUG:] preinstall cofudlet
[DEBUG:] postinstall cofudlet
[DEBUG:] Done reloading pkg cofudlet
I suspect this is probably caused by muddler writing directly into .output. This truncates the file, which Mudlets reacts on, before adding the new content.
To make this process atomic, create a new temporary file somewhere in the same directory (or at least filesystem), then rename the temp file into .output, overwriting the original.