sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

I unable to build package for SPfx 1.5 version

Open rajput9997 opened this issue 8 years ago • 32 comments

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.

image

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

image

I'm not sure what is missing part from my end?

Thanks!

rajput9997 avatar Jun 20 '18 12:06 rajput9997

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"
  }
}

PooLP avatar Jun 20 '18 12:06 PooLP

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.

image

rajput9997 avatar Jun 20 '18 13:06 rajput9997

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

PooLP avatar Jun 20 '18 13:06 PooLP

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. image

valpvt avatar Jun 20 '18 15:06 valpvt

which version of node.js/npm you are using ?

PooLP avatar Jun 20 '18 16:06 PooLP

The steps doesn't help out to resolve the issue and showing same error. nodejs version - v8.5.0 npm version - 6.1.0

rajput9997 avatar Jun 20 '18 18:06 rajput9997

nodejs version - v8.11.2 npm version - 6.1.0

valpvt avatar Jun 21 '18 06:06 valpvt

This day, I will test this https://github.com/waldekmastykarz/docker-spfx, i don't have your problem, but I have anothers problems

PooLP avatar Jun 21 '18 06:06 PooLP

Hello, I have the same problem.

nodejs version - v8.11.2 npm version - 6.1.0

capture

maximreynaud avatar Jun 21 '18 13:06 maximreynaud

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/

PooLP avatar Jun 21 '18 13:06 PooLP

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

valpvt avatar Jun 21 '18 14:06 valpvt

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 avatar Jun 21 '18 18:06 waldekmastykarz

@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?

valpvt avatar Jun 22 '18 06:06 valpvt

Thanks for the additional info @val0o. Are you getting the same issue with a vanilla [email protected] project?

waldekmastykarz avatar Jun 22 '18 06:06 waldekmastykarz

@waldekmastykarz Indeed, I have the same issue with a vanilla SPFx ApplicationCustomizer extension

valpvt avatar Jun 22 '18 06:06 valpvt

@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 avatar Jun 22 '18 06:06 waldekmastykarz

@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.

rajput9997 avatar Jun 22 '18 09:06 rajput9997

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.

ghost avatar Jun 25 '18 10:06 ghost

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.

nateforsyth avatar Jun 25 '18 22:06 nateforsyth

We are closely looking into fixing this soon. Thanks for reporting.

VesaJuvonen avatar Jun 26 '18 17:06 VesaJuvonen