I am new to SPFx, tried to create simple webpart using SPFx. Referred from here.

Followed these steps:
-Installed nodejs
-Installed gulp & yomen using npm install -g yo gulp in powershell.
-Loaded sharepoint framework using npm install -g @microsoft/generator-sharepoint

-Now created a new directory using md helloworldspfx
-Navigated to the directory cd helloworldspfx
-Tried to create the webpart using yo @microsoft/sharepoint
-Installed developer certificate gulp trust-dev-cert
-Tried to build & preview the webpart using gulp serve

Now workbench page opens up in chrome like this, enter image description here

There is no error showing in the windows powershell.
Please help.

I have been using Node.js v8.9.
With the help of answer setting the NODE_NO_HTTP2=1 environment variable to disable the experimental feature.
Like this, $env:NODE_NO_HTTP2="1" in powershell (set NODE_NO_HTTP2=1 in CMD) to fix the issue.

  • Did you try deleting .gcb-serve-data directory and running gulp trust-dev-cert again. See github.com/Microsoft/… – Bunzab Nov 2 '17 at 13:52
  • @Bunzab tried deleting .gcb-serve-data diretory & installed development certificate, but no change... – Vishnu S Nov 3 '17 at 4:05

Are you using Node.js v8 by any chance? If so, there is a known issue with the http/2 experimental feature. You can disable it by setting the NODE_NO_HTTP2=1 environment variable. More information about the fix is available at https://github.com/SharePoint/sp-dev-docs/issues/1002.

| improve this answer | |
  • Thanks guys! On Mac you run it on the command line like this: NODE_NO_HTTP2=1 gulp serve – Toby Beresford Nov 7 '17 at 16:09
  • I'm having the same issue.But this solution not worked for me. Still having the same issue. Node.js 9.4.0... – Jerry_MSFT Jan 15 '18 at 13:23
  • 1
    Node v9 (same as v8 btw) is not yet supported by SPFx. You should downgrade to at least v8, or even the recommended v6 which has been tested with SPFx. – Waldek Mastykarz - MVP Jan 16 '18 at 18:28
  • Node v8 is now supported by SPFx but you still need to apply the $env:NODE_NO_HTTP2="1" PowerShell command in the same PowerShell window as you run gulp serve. – Koen Zomers Jun 1 '18 at 8:22
  • 1
    am using node v 10, am facing the same issue, even after setting the variable it's not working – JishinK May 20 '19 at 17:52

Same issue here - I guess in our network there's no certificate for localhost? Worked around it by changing to http in config > serve.json:

"initialPage": "http://localhost:5432/workbench",
"https": false,
| 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.