Sp-dev-fx-webparts: Broken command `gulp package-solution --ship` for web parts

Created on 22 Sep 2017  Â·  8Comments  Â·  Source: pnp/sp-dev-fx-webparts

Category

  • [ ] Question
  • [x] Bug
  • [ ] Enhancement

Expected or Desired Behavior

gulp task package-solution --ship should build a package prepared to be deployed to the prod environment.

Observed Behavior

gulp task throws an exception:
image

Steps to Reproduce

  1. install web-part template by typing yo @microsoft/sharepoint
  2. choose web-part template without react
  3. when installation is finished type gulp build --ship
  4. and then type gulp package-solution --ship

It doesn't matter whether property cdnBasePath in the file ./config/write-manifests.json is properly defined or not. The exception is always the same.

The workaround that I've found is to use command gulp serve --nobrowser --ship before executing gulp build --ship.

Any ideas? Am I doing something wrong?

All 8 comments

gulp package-solution --ship depends on the gulp bundle --ship task. This dependency isn't explicit, but it is required for the package-solution task to run properly. If you don't run bundle first, you will the error that you're seeing.

Yep, that was the problem!
I've missed the gulp bundle --ship command.
It works now, thank you!

You're welcome!

Hi waldekmastykarz ,

I am facing the same issue even after i tried gulp bundle --ship.

Thanks, Pal

@rpalanivel83 what error do you see? Can you reproduce it in a clean solution?

Hi Waldekmastykarz,
Thanks for your response. I have resolved this issue. This is due to I had included external js in config.json without “http://“.

Thanks,Pal

Hi @waldekmastykarz I have choose web-part template wtih react. Now I'm running _gulp bundle --ship_ at that moment, I'm not able to find any additional file inside teams after that agian I run _gulp package-solution --ship_. So, it is throwing error. Please check it and try to resolve it.

error

Looking forward for your response.

Hello @waldekmastykarz The error is resolved. just I restart everything and try again now it is working fine.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Abiman194 picture Abiman194  Â·  4Comments

PathToSharePoint picture PathToSharePoint  Â·  4Comments

russgove picture russgove  Â·  4Comments

MaxDaxDax picture MaxDaxDax  Â·  4Comments

parmira5 picture parmira5  Â·  4Comments