Hi all,
When I have an error in my javascript, jshint crashes my gulp watch script and I need to restart it in order to continue working. It’s quite frustrating and I’m sure a few people have also encountered this issue.
Could someone recommend a solution which would just display the error and not build the javascript, instead of crashing the gulp watch process please?
➜ my_theme git:(master) ✗ gulp watch
[08:29:32] Using gulpfile ~/Development/my_website/site/web/app/themes/my_theme/gulpfile.js
[08:29:32] Starting 'watch'...
[08:29:32] Finished 'watch' after 54 ms
[BS] Proxying: http://my_website.dev
[BS] Access URLs:
---------------------------------------
Local: http://localhost:3000
External: http://192.168.17.129:3000
---------------------------------------
UI: http://localhost:3001
UI External: http://192.168.17.129:3001
---------------------------------------
[BS] Watching files...
[08:29:38] Starting 'jshint'...
assets/scripts/main.js
line 78 col 25 Expected an identifier and instead saw '.'.
line 78 col 25 Expected an assignment or function call and instead saw an expression.
line 78 col 26 Missing semicolon.
✖ 2 errors
⚠ 1 warnings
[08:29:38] Finished 'jshint' after 305 ms
[08:29:38] Starting 'scripts'...
stream.js:94
throw er; // Unhandled stream error in pipe.
^
Error
at new JS_Parse_Error (eval at <anonymous> (/home/james/Development/my_website/site/web/app/themes/my_theme/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:1526:18)
at js_error (eval at <anonymous> (/home/james/Development/my_website/site/web/app/themes/my_theme/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:1534:11)
at croak (eval at <anonymous> (/home/james/Development/my_website/site/web/app/themes/my_theme/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2026:9)
at token_error (eval at <anonymous> (/home/james/Development/my_website/site/web/app/themes/my_theme/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2034:9)
at unexpected (eval at <anonymous> (/home/james/Development/my_website/site/web/app/themes/my_theme/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2040:9)
at eval (eval at <anonymous> (/home/james/Development/my_website/site/web/app/themes/my_theme/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2130:17)
at eval (eval at <anonymous> (/home/james/Development/my_website/site/web/app/themes/my_theme/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2073:24)
at block_ (eval at <anonymous> (/home/james/Development/my_website/site/web/app/themes/my_theme/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2353:20)
at eval (eval at <anonymous> (/home/james/Development/my_website/site/web/app/themes/my_theme/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2120:29)
at eval (eval at <anonymous> (/home/james/Development/my_website/site/web/app/themes/my_theme/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2073:24)
at if_ (eval at <anonymous> (/home/james/Development/my_website/site/web/app/themes/my_theme/node_modules/gulp-uglify/node_modules/uglify-js/tools/node.js:24:4), <anonymous>:2336:44)
`