I unable to build package for SPfx 1.5 version
Category
- [x] Question
- [ ] Typo
- [x] Bug
- [ ] Additional article idea
I created SPFx webpart solution along with ReactJs framework. while I build the package solution using gulp bundle --ship, I unable to finish build successfully and following error showing into logged.
The build failed because a task wrote output to stderr.

I believe due to above screenshot error, i unable to complete gulp package-solution --ship. I've used includeClientSideAssets": true into package-solution.json file.
My Attempts:
I checked all version of packages and all are updated. I've confirmed through
npm updated.
I executed following command to get clean and again build the solution.
gulp clean gulp build gulp build --ship (failed on this case and error shown above screenshot)
Following attached screenshot for package.json file

I'm not sure what is missing part from my end?
Thanks!
Hi, React 16 don't work with 1.5.0 Framework, use React 15.
{
"name": "webpart-hello-world-react-1-5-0",
"version": "0.0.1",
"private": true,
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"build": "gulp bundle",
"clean": "gulp clean",
"test": "gulp test"
},
"dependencies": {
"react": "15.6.2",
"react-dom": "15.6.2",
"@types/react": "15.6.6",
"@types/react-dom": "15.5.6",
"@microsoft/sp-core-library": "1.5.0",
"@microsoft/sp-webpart-base": "1.5.0",
"@microsoft/sp-lodash-subset": "1.5.0",
"@microsoft/sp-office-ui-fabric-core": "1.5.0",
"@types/webpack-env": "1.13.1",
"@types/es6-promise": "0.0.33"
},
"devDependencies": {
"@microsoft/sp-build-web": "1.5.0",
"@microsoft/sp-module-interfaces": "1.5.0",
"@microsoft/sp-webpart-workbench": "1.5.0",
"gulp": "~3.9.1",
"@types/chai": "3.4.34",
"@types/mocha": "2.2.38",
"ajv": "~5.2.2"
}
}
Hi @PooLP , Thanks for your promptly response. I upgraded package solution back to react 15 version and installed into project as well globally but it doesn't resolve my issue yet.

After downgrading, delete package-lock.json file en node_modules, lib, dist and temp directory and re-run npm install, after, run gulp bundle --ship and gulp package-solution --ship
Hi folks,
I have same issue after trying to upgrade from 1.4.1 to 1.5.0. I have already removed the package-lock.json and reinstalled all node modules without success.
It does not prevent from having a final package but for instance the styles are not applied to my ApplicationCustomizer extension.

which version of node.js/npm you are using ?
The steps doesn't help out to resolve the issue and showing same error. nodejs version - v8.5.0 npm version - 6.1.0
nodejs version - v8.11.2 npm version - 6.1.0
This day, I will test this https://github.com/waldekmastykarz/docker-spfx, i don't have your problem, but I have anothers problems
Hello, I have the same problem.
nodejs version - v8.11.2 npm version - 6.1.0
I have tested on docker image and i don't have problem
Images on Docker Store : https://hub.docker.com/r/waldekm/spfx/ Tuto : https://blog.mastykarz.nl/sharepoint-framework-docker/ Docker + SPFx 1.5.0 : https://blog.mastykarz.nl/sharepoint-framework-1-5-0-docker-image-caveats/
Hi @PooLP I have tried the same with the Docker image from @waldekmastykarz and I encountered the same error. So it does not depend on the node/npm environment
Have you tried creating a new project from scratch and comparing the differences between the new one and yours just to be sure you haven't missed anything?
@waldekmastykarz Yes I have compared the files in the config folder and gulpfile, tsconfig, .yo-rc.jspackage.json but did not find anything. Actually it seems to be related to sass in --ship mode, I notice that I can deploy the final package and assets but I don't have the CSS applied to my ApplicationCustomizer extension. I hope it can give you a clue?
Thanks for the additional info @val0o. Are you getting the same issue with a vanilla [email protected] project?
@waldekmastykarz Indeed, I have the same issue with a vanilla SPFx ApplicationCustomizer extension
@val0o that might be worth submitting a separate issue. With [email protected] coming soon it would be good to have it double checked by the engineering
@waldekmastykarz @val0o - Hi All, I've producing the same error even in new project. When i updated to 1.4.1 version, it seem to working fine.
I can confirm that the default build of the hello-world webpart also has the --ship error. Same error exaclty as is mentioned above. I have built and packaged multiple solutions with this hardware before so this is new. I also built a brand new machine and ran through the tutorial exactly and I am getting the same --ship error on that new machine also.
I as well can confirm that the update from 1.4.1 to 1.5.0 caused the issue encountered by the OP.
I'm pretty new to all of this, thought I'd share my steps to roll back to version 1.4.1.
Firstly, uninstall the sp-* packages.
npm uninstall @microsoft/sp-dialog
npm uninstall @microsoft/sp-application-base
npm uninstall @microsoft/decorators
npm uninstall @microsoft/sp-core-library
npm uninstall @microsoft/sp-listview-extensibility
npm uninstall @microsoft/sp-lodash-subset
npm uninstall @microsoft/sp-office-ui-fabric-core
npm uninstall @microsoft/sp-webpart-base
npm uninstall @microsoft/sp-build-web
npm uninstall @microsoft/sp-webpart-workbench
npm uninstall @microsoft/sp-extension-base
npm uninstall @microsoft/sp-http
npm uninstall @microsoft/sp-module-interfaces
Next I reinstalled the desired versions of each.
npm install @microsoft/[email protected] --save
npm install @microsoft/[email protected] --save
npm install @microsoft/[email protected] --save
npm install @microsoft/[email protected] --save
npm install @microsoft/[email protected] --save
npm install @microsoft/[email protected] --save
npm install @microsoft/[email protected] --save
npm install @microsoft/[email protected] --save
npm install @microsoft/[email protected] --save
npm install @microsoft/[email protected] --save
npm install @microsoft/[email protected] --save
npm install @microsoft/[email protected] --save
npm install @microsoft/[email protected] --save
I then pruned and cleared the cache.
npm-prune
npm cache clean --force
Clean, build, and shrinkwrap.
gulp clean
gulp build
npm shrinkwrap
I've then tested in the workbench prior to building a shipping package and deploying to a test tenant.
We are closely looking into fixing this soon. Thanks for reporting.