0

On my SharePoint 2016 on-premise development site workbench, to load my SPFx webpart in the config\server.json I have set the "https": false. My development site loads on http and in my browser console I can see request is sent to http://localhost:4321/temp/manifests.js, it successfully resolved and I can add my webpart to the page to test it.

If I set "https": true in config\server.json request is made to https://localhost:4321/temp/manifests.js (notice https). But the request returns error as

GET https://localhost:4321/temp/manifests.js net::ERR_SSL_PROTOCOL_ERROR
Failed to load debug manifests: Error: Error loading https://localhost:4321/temp/manifests.js
    XHR error loading https://localhost:4321/temp/manifests.js
GET http://localhost:4321/temp/manifests.js net::ERR_INVALID_HTTP_RESPONSE
Uncaught (in promise) Error: Error loading http://localhost:4321/temp/manifests.js
    XHR error loading http://localhost:4321/temp/manifests.js
    at XMLHttpRequest.o (eval at <anonymous> (sp-webpart-workbench-assembly_en-us_1c43756ae201421249073388e4dea068.js:1171), <anonymous>:4:14084)

and the page shows:

Your web part will not appear in the toolbox. Please make sure "gulp serve" is running in a web part project. Please refresh the page once "gulp serve" is running.

When I try to run the webpart on my SharePoint Online workbench with either "https": true OR "https": false set in config\server.json, I am unable to load the webpart with same error as above.

I have deleted the <homedir>/.gcb-serve-data directory and run the gulp trust-dev-cert again, but it has't worked.

How can I load /temp/manifests.js on https?

1

Finally figured out what was the problem.

  1. Before doing gulp serve run the command set NODE_NO_HTTP2=1. This will allow the manifestes.js file to be served over https.
  2. Before opening the SharePoint Online workbench, access the URL https://localhost:4321/temp/manifests.js from your browser. It may give you warning that it is not really secure, continue anyway. Now open the SharePoint Online workbench.

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.