Sp-dev-docs: Error when displaying HelloWorld web part in (non developer site collection) of tenant workbench

Created on 16 Jan 2018  路  8Comments  路  Source: SharePoint/sp-dev-docs

Thank you for reporting an issue or suggesting an enhancement. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you.

Category

  • [ ] Question
  • [ ] Typo
  • [X ] Bug
  • [ ] Additional article idea

If you are planning to share a new feature request (enhancement / suggestion), please use SP Dev UserVoice at http://aka.ms/sp-dev-uservoice.

Expected or Desired Behavior

Based on current documentation, tenant workbench should function within both developer and non-developer site collections.
ss1

Observed Behavior

SPFx HelloWorld web part works fine within localhost workbench and tenant developer site collection workbench. On a non-developer site collection, I can add it to my workbench, but then it displays the following error.
ss2

Steps to Reproduce

  1. Run gulp serve within the context of HelloWorld SPFx sample
  2. Confirm it functions correctly in localhost workbench.
  3. Confirm it functions correctly within a developer site collection tenant workbench.
  4. Try adding/viewing it on a non-developer site collection tenant workbench.
    I am using node 6.12.3 and here is my solution without the node_modules directory: HelloWorld.zip

Most helpful comment

Thanks @waldekmastykarz. Does it make sense that it would still work in the localhost workbench, even with that error?
I went ahead and created a brand new instance of the HelloWorld web part and that one does appear to work in the hosted workbench of a non-developer site collection. I'm not sure what I did to the first one, but obviously something that 'broke' it. Thanks again for your help.

All 8 comments

When on step 4), is your local web server still running? It seems like the workbench cannot load the bundle from your local machine.

Hi @waldekmastykarz, thanks for the response. Yes, it's still running. I've also added a zip attachment above with my solution minus the node_module directory.

What do you see when you try to open in the browser https://localhost:4321/dist/hello-world.bundle.js?

@waldekmastykarz - The following is the message I receive in another browser tab, where my localhost workbench shows the web part successfully.
ss1

Which explains why the web part cannot be loaded in the workbench. Have you by any chance renamed the web part in the process or changed the name of its bundle?

What you could also try is running the following commands:

gulp clean
gulp serve

The first one will clear the output directory in case you have some stale files. The second one will rebuild and bundle your project and start local workbench, where you will be able to confirm that the web part is working. Once you confirm, that you can add it in the local workbench, you can navigate to the hosted workbench and should be able to add it there as well.

Thanks @waldekmastykarz. Does it make sense that it would still work in the localhost workbench, even with that error?
I went ahead and created a brand new instance of the HelloWorld web part and that one does appear to work in the hosted workbench of a non-developer site collection. I'm not sure what I did to the first one, but obviously something that 'broke' it. Thanks again for your help.

thx @tracy-zaact for following up and closing the issue. Also thx @waldekmastykarz for the support.

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

Was this page helpful?
0 / 5 - 0 ratings