saxifrage / cityasacampus

An open-source platform for connecting and showcasing resources within local learning communities.
http://cityasacampus.org/
5 stars 4 forks source link

teach gulp to give better errors on parse failures #378

Open chadwhitacre opened 8 years ago

chadwhitacre commented 8 years ago

I can't tell from the following error output what file the error is in. Am I missing it or is it indeed not there?

$ node_modules/.bin/gulp
[17:45:39] Using gulpfile ~/workbench/saxifrage/learnpgh.org/gulpfile.js
[17:45:39] Starting 'default'...
[17:45:39] Starting 'js-vendors'...
[17:45:39] Starting 'js-app'...
[17:45:39] Starting 'templates'...
[17:45:39] Starting 'images'...
[17:45:39] Starting 'css-app'...
[17:45:40] Finished 'js-vendors' after 229 ms
[17:45:40] Finished 'css-app' after 280 ms

events.js:141
      throw er; // Unhandled 'error' event
      ^
Error: app.min.js: error: couldn't process source due to parse error
Unexpected token (140:23)
    at transform (/Users/whit537/workbench/saxifrage/learnpgh.org/node_modules/gulp-ng-annotate/index.js:20:11)   
    at Transform._transform (/Users/whit537/workbench/saxifrage/learnpgh.org/node_modules/gulp-ng-annotate/index.js:68:25)
    at Transform._read (/Users/whit537/workbench/saxifrage/learnpgh.org/node_modules/gulp-ng-annotate/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at Transform._write (/Users/whit537/workbench/saxifrage/learnpgh.org/node_modules/gulp-ng-annotate/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:12)
    at doWrite (/Users/whit537/workbench/saxifrage/learnpgh.org/node_modules/gulp-ng-annotate/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:237:10)
    at writeOrBuffer (/Users/whit537/workbench/saxifrage/learnpgh.org/node_modules/gulp-ng-annotate/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:227:5)
    at Transform.Writable.write (/Users/whit537/workbench/saxifrage/learnpgh.org/node_modules/gulp-ng-annotate/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:194:11)
    at write (/Users/whit537/workbench/saxifrage/learnpgh.org/node_modules/gulp-concat/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
    at flow (/Users/whit537/workbench/saxifrage/learnpgh.org/node_modules/gulp-concat/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7)
    at DestroyableTransform.pipeOnReadable (/Users/whit537/workbench/saxifrage/learnpgh.org/node_modules/gulp-concat/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:664:5)
$ 

cf. #373

chadwhitacre commented 8 years ago

Here's another example, this time for a stylesheet(?):

$ node_modules/.bin/gulp 
[17:48:18] Using gulpfile ~/workbench/saxifrage/learnpgh.org/gulpfile.js
[17:48:18] Starting 'default'...
[17:48:18] Starting 'js-vendors'...
[17:48:18] Starting 'js-app'...
[17:48:18] Starting 'templates'...
[17:48:18] Starting 'images'...
[17:48:18] Starting 'css-app'...

events.js:141
      throw er; // Unhandled 'error' event
      ^
Error: client/index.scss
Error: File to import not found or unreadable: ./dashboard/map/MapStyle
       Parent style sheet: stdin
        on line 24 of stdin
>> @import './dashboard/map/MapStyle';
   ^

    at options.error (/Users/whit537/workbench/saxifrage/learnpgh.org/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:277:32)
$
chadwhitacre commented 8 years ago

Oh! There we have a filename. :-)