7

I'm trying to build a simple client-side web part using new SharePoint Framework with the help of OfficeDev Site. I've installed all the required components mentioned in OfficeDev

After the installation, when I enter 'gulp serve' command to run the webpart, It opens SharePoint Workbench in the browser But with blank white screen.

Any one encountered the same issue?

UPDATE:

I've uploaded the screenshot of gulp output and the blank screen

enter image description here

2
  • Can you add the output of gulp when you access the workbench?
    – Benny Skogberg
    Commented Sep 3, 2016 at 6:32
  • You mean a totally blank screen? What does the page-source contain? Commented Sep 3, 2016 at 8:48

4 Answers 4

11

In the 0.1.0 version of @microsoft/generator-sharepoint it has started setting gulp serve to use https. This is the right approach so you don't have to set your browser to allow unsafe scripts, but for this to work properly you have to configure certificates.

I guess we'll get a nice description of how to configure this rightly, but for now the easiest solution is to change config\serve.json to:

{
  "port": 4321,
  "initialPage": "http://localhost:5432/workbench",
  "https": false,
  "api": {
    "port": 5432,
    "entryPath": "node_modules/@microsoft/sp-webpart-workbench/lib/api/"
  }
}
4

I assume you have installed Node, Gulp and Yeoman without errors. I also assume you have created a new SPFx project using the command

yo @microsoft/sharepoint

When done you navigate to the root folder of your project (if not already there) and type

gulp serve

I've made many mistakes typing server instead of serve, so pay attention to the correct command. This opens the workbench where you can add your Web Part if you hover over the canvas and hit the plus-sign in the middle.

enter image description here

0

Make sure you hit the local workbench first and accept the unsigned cert. https://github.com/SharePoint/sp-dev-docs/issues/165

0

You need to add the webpart you have created. So after running gulp serve you will see the workbench screen. after this you need to do move your mouse over the screen and click on the + sign which appears. This will display available webparts, from this you need to select your webpart in order to see it working. I hope this helps. enter image description here

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