1

Hi I upgraded my project from drop1 to drop2 follwing the instructions at https://github.com/SharePoint/sp-dev-docs/wiki/Release-Notes-Drop-2.

I cannot get my webpart to load mow. I keep getting the error [enter image description here].

1

Isn't it supposed to be using https: after the upgrade? Server.json was updated with: { "https":"true", "port": 4321, "initialPage": "https://localhost:5432/workbench", "api": { "port": 5432, "entryPath": "node_modules/@microsoft/sp-webpart-workbench/lib/api/" } }

any ideas?

2 Answers 2

2

Solution 1: Use http

Just change the `config/server.json' to disable https and use http, when working with the SharePoint hosted WorkBench (and testing inside SharePoint from localhost).

You then of cause have to accept unsafe scripts like in drop 1.

Solution 2: Get browser to accept invalid certificate

This is my cookbook for Chrome:

  1. Start server gulp serve --nobrowser
  2. Load https://localhost:4321/temp/manifests.js
  3. You'll probably get the following error message: Invalid cert
  4. Click ADVANCED and then "Proceed to localhost (unsafe)"
    Proceed to localhost
  5. This should load the ugly mninified manifest, just ignore this
  6. Load https://YourMachine:4321/dist/YourWebPart.bundle.js
  7. Repeat step 4 (except that it now says "Proceed to YourMachineName (unsafe)"
  8. This should load the "beautiful" bundle, but again just it
  9. Now you should be able to load the workbench
1

To preview your web part, build and run it on a local web server. The client-side toolchain uses HTTPS endpoint by default. However, since a default certificate is not configured for the local dev environment, your browser will report a certificate error.To install the developer certificate for use with SPFx development, switch to your console, make sure you are still in the project directory and enter the following command:

gulp trust-dev-cert

Please refer https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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