Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gulp bundle --ship: The build failed because a task wrote output to stderr

I've been getting this error when trying to do a gulp bundle --ship command:

The build failed because a task wrote output to stderr. Exiting with exit code: 1

I'm pretty new to this so have no idea how to proceed with it. It's happening even when I run through the helloworld webpart now. The gulp serve works and I can bundle and package the solution as long as I don't add a --ship to it. I've written and published apps before on the same machine so I don't know what is different now.

I've uninstalled every extension and re-installed the application but it's still doing it. Any help would be appreciated.

like image 814
Gary Avatar asked Jun 21 '18 12:06

Gary


2 Answers

Just for quick win you can use --debug flag for bundling task instead of --ship until this bug will be fixed in future releases:

gulp bundle --debug
gulp package-solution --ship

The bundled file will be bigger, but at least you are not getting "The build failed because a task wrote output to stderr" error in CI/CD.

like image 52
Ruslan Korkin Avatar answered Sep 17 '22 12:09

Ruslan Korkin


It normally happens because of the warnings. You can add suppression like mentioned below in gulpfile.js build.addSuppression(Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.); build.addSuppression(/Warning/gi);

like image 33
ashish baranwal Avatar answered Sep 19 '22 12:09

ashish baranwal