qooxdoo-compiler icon indicating copy to clipboard operation
qooxdoo-compiler copied to clipboard

errors in compile.json while running qx serve stops compiling

Open voger opened this issue 5 years ago • 2 comments

I tried adding a new environment entry in compile.json while the qx serve command was running. The file was saved without beeing syntactically correct. I got this exception

Writing application tinyclone
>>> Compiled 1 classes in 27.367s
Applications are made
(node:22802) UnhandledPromiseRejectionWarning: Error: Failed to load compile.json: SyntaxError: Unexpected token <"tinyclone.apiServer"> at 10:9
        "tinyclone.apiServer": "http://localhost:4000/api/"
        ^
    at Object.loadJsonAsync (/home/voger/.nvm/versions/node/v8.15.0/lib/node_modules/@qooxdoo/compiler/source/class/qx/tool/utils/Json.js:146:15)
    at <anonymous>
(node:22802) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:22802) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

and while the qx serve application didn't terminate, it stopped watching for changes and compiling, and doesn't serve any new changes of the code.

voger avatar Nov 10 '19 16:11 voger

Hi, same problem with qx compile --watch

Just a little more details.

It seems that loadJsonAsync (qx.tool.utils.Json.js:138) correctly throw an error when there is a problem (with a try/catch block), however the call to loadJsonAsync are neither in a try/catch block or with a .catch function, for example in my case (compile watch) it is in qx.tool.cli.api.CompilerApi.js:62, i do not know if it is the same place for qx serve i didn't test it.

rommni avatar Nov 12 '19 07:11 rommni

@johnspackman Can you have a look - you know the code best.

cboulanger avatar Nov 12 '19 07:11 cboulanger