qooxdoo / qooxdoo-compiler

Compiler for Qooxdoo, 100% javascript
MIT License
36 stars 23 forks source link

errors in compile.json while running qx serve stops compiling #594

Open voger opened 4 years ago

voger commented 4 years ago

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.

rommni commented 4 years ago

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.

cboulanger commented 4 years ago

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