Hello,
I am running nodebb 1.8.1 and developing few custom plugins. To build I generally use ./nodebb build from command line.
When there is an error, I sometimes get the following message:
D:\nb>nodebb build "javascript"
started
2018-04-04T20:29:53.546Z [155564] - info: [build] Building in parallel mode
2018-04-04T20:29:53.548Z [155564] - info: [build] plugin static dirs build started
2018-04-04T20:29:53.553Z [155564] - info: [build] requirejs modules build started
2018-04-04T20:29:53.554Z [155564] - info: [build] client js bundle build started
2018-04-04T20:29:53.556Z [155564] - info: [build] admin js bundle build started
2018-04-04T20:29:57.282Z [155564] - info: [build] plugin static dirs build completed in 3.734sec
2018-04-04T20:30:03.510Z [155564] - error: [build] client js bundle build failed
2018-04-04T20:30:03.512Z [155564] - error: [build] Encountered error during build step SyntaxError: Unexpected token: punc (,)
at JS_Parse_Error.get (eval at <anonymous> (D:\nb\node_modules\uglify-js\tools\node.js:21:1), <anonymous>:75:23)
at D:\nb\src\meta\minifier.js:115:19
at D:\nb\src\meta\minifier.js:242:11
at D:\nb\node_modules\async\dist\async.js:1126:9
at D:\nb\node_modules\async\dist\async.js:473:16
at iterateeCallback (D:\nb\node_modules\async\dist\async.js:980:24)
at D:\nb\node_modules\async\dist\async.js:958:16
at D:\nb\node_modules\async\dist\async.js:1123:13
at D:\nb\src\meta\minifier.js:212:4
at D:\nb\node_modules\graceful-fs\graceful-fs.js:78:16
2018-04-04T20:30:03.513Z [155564] - error: SyntaxError: Unexpected token: punc (,)
at JS_Parse_Error.get (eval at <anonymous> (D:\nb\node_modules\uglify-js\tools\node.js:21:1), <anonymous>:75:23)
at D:\nb\src\meta\minifier.js:115:19
at D:\nb\src\meta\minifier.js:242:11
at D:\nb\node_modules\async\dist\async.js:1126:9
at D:\nb\node_modules\async\dist\async.js:473:16
at iterateeCallback (D:\nb\node_modules\async\dist\async.js:980:24)
at D:\nb\node_modules\async\dist\async.js:958:16
at D:\nb\node_modules\async\dist\async.js:1123:13
at D:\nb\src\meta\minifier.js:212:4
at D:\nb\node_modules\graceful-fs\graceful-fs.js:78:16
This message is very generic and does not give me any clue were to look. I often resolve this issue by exhaustive search over my new code, specially looking at style and template files to find the error. I am however refactoring large part of my code and looking at diffs is becoming very time consuming if not impossible.
Is there an easy way to make uglify.js more verbose so it can tell me which file is breaking the build?
Any hint would be appreciated.
Thank you.