0

I pulled the tiles out of the starter kit here, https://github.com/eoverfield/sp-starter-kit. I get NO errors when I do npm install and run gulp serve.

Everything works fine locally, but when I package the .sppkg, I come up with the error below:

ERROR message when I put it in SPO:

enter image description here

NPM and Node Version:

enter image description here

I think it has to do with the versioning of my NPM and Node?

Or maybe the launch.json needs to have the directory rather than the localhost:4321?

I am lost and any suggestions would be appreciated.

1

Try running below commands in your package folder:

  • npm install
  • npm install @pnp/spfx-property-controls --save --save-exact
  • gulp serve
  • gulp trust-dev-cert

Then while packaging your solution run below commands:

  • gulp build
  • gulp bundle --ship
  • gulp package-solution --ship

official documentation: Host your client-side web part from Office 365 CDN.

| improve this answer | |
  • Is dependency of @pnp/spfx-property-controls is added in your package.json file?? – Ganesh Sanap Dec 5 '19 at 6:24
  • 1
    It was not; maybe that did it. I followed the packaging commands and it works! Before I did not build and bundle before I packaged the solution. – Lance Bitner Dec 5 '19 at 13:58
1

When you run locally it run without error because all file are run from local but upload package (i.e. sppkg), still your file are resides locally. If you read error it is specifying that local server is not running.

Kindly follow

https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/hosting-webpart-from-office-365-cdn

above documentation which will show you how to upload webpart depended files to cdn or on SharePoint Online.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.