SharePoint Framework gulp serve localhost sent an invalid response
-
04-01-2021 - |
题
I'm testing a newly created webpart locally using the gulp serve
command after launching the gulp trust-dev-cert
for certification installation, the local workbench opens up but all browsers are displaying the same error. Here's a screenshot from google chrome :
What I've tried :
- Disabling firewall
I've googled and googled but with no success.
Does anyone have an idea about what's happening ?
解决方案
Try to give a look to the tip of Waldek Mastykarz if you are using latest LTS of Node.js here, it solved the issue for me (no need to disable firewall) : https://github.com/SharePoint/sp-dev-docs/issues/1002
其他提示
For Windows 10, Node version 8.9.1, SPFx version 1.4.0 below is the solution:
Add System variable
Control Panel -> System -> Advanced System Settings -> Environment Variables -> System Variables)
- Variable name: NODE_NO_HTTP2
- Variable value: 1
Don't forget to restart terminal.