In case of syntax errors, coderunner does not print the file name and line number:
C:\somewhere\backendless >npm run debug
> App-servercode@1.0.0 debug C:\somewhere\backendless
> coderunner debug
16:03:17.618 - CodeRunner(tm) Backendless Debugging Utility v1.6.0
16:03:17.621 - Copyright(C) 2016 Backendless Corp. All rights reserved.
16:03:17.878 - Starting Debug Code Runner...
16:03:17.886 - Building Model..
16:03:17.888 - Error: Unexpected token )
16:03:17.889 - Error: Expected () to start arrow function, but got ';' instead of '=>'
16:03:17.890 - Model Build completed
16:03:17.890 - Model is empty
16:03:17.890 - Error: Nothing to Debug
Hi Michel
Thanks for the report.
This functionality was added in v1.7.0
Also, in verbose mode the CodeRunner will print the full stack trace of the error
To enable verbose mode, just run it like this:
npm run debug -- --verbose
Hi Vitaly,
I tried 1.7.0 and yes, debug does print a stack trace, but it does not show me where the syntax error is:
11:54:10.272 - Reading C:\Users\User\git\project\app\rssparser.js...
11:54:10.306 - Reading C:\Users\User\git\project\app\timers\updateCabine.js...
11:54:10.314 - Reading C:\Users\User\git\project\app\timers\updatenewsfromfeeds.js...
11:54:10.324 - SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at Module.require (C:\Users\User\git\project\node_modules\backendless-coderunner\lib\server-code\api\index.js:345:32)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\Users\User\git\project\app\timers\updatenewsfromfeeds.js:9:14)
at Module._compile (module.js:409:26)
11:54:10.328 - Reading C:\Users\User\git\project\app\utils.js...
11:54:10.328 - Model Build completed
11:54:10.329 - Timers (1):
11:54:10.329 - UpdateCabine (app\timers\updateCabine.js)
11:54:10.329 - Errors (3):
11:54:10.330 - Unexpected token { (app\models\cabine.js)
11:54:10.330 - Unexpected token { (app\models\news.js)
11:54:10.330 - Unexpected token { (app\models\news.js)
Still, no line number given. The stacktrace is useless in this case.
Please reopen this issue.