Sp-dev-docs: [Updated] SpFx Extensions OnRender() is no longer called on previously functional tenants

Created on 25 Aug 2017  路  7Comments  路  Source: SharePoint/sp-dev-docs

Category

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

Expected or Desired Behavior

A new dev tenant will support SpFx webparts & extensions by default after creation per guidance at https://github.com/SharePoint/sp-dev-docs/blob/master/docs/spfx/enterprise-guidance.md

Observed Behavior

SpFx extensions cannot be debugged out-of-box. Code embedded in the OnRender() method is never called. Code embedded in OnInit() method is called as expected.

Settings -> Custom Script

  • Allow users to run custom script on personal sites
  • Allow users to run custom script on self-service created sites

Steps to Reproduce

Office 365

  1. Create a dev tenant per instructions at https://dev.office.com/sharepoint/docs/spfx/set-up-your-developer-tenant
  2. Create a modern communication site

Local

  1. Install nodejs LTM
  2. npm install -g yo gulp @ microsoft/generator-sharepoint (1.1.3 at time of writing)
  3. yo @ microsoft/sharepoint

    • Select "extension"

    • All others default

  4. gulp serve
  5. Use the ?loadSPFX query string markup on the modern team site

Most helpful comment

All 7 comments

To follow-up on this, I have created half a dozen tenants via

The only one which calls the OnRender() function is the tenant created via https://demos.microsoft.com/, even after setting the Allow script settings in the admin center in the others. This might be related to provisioning issues suggested in #808

Even after changing the proposed settings in the SharePoint admin page, the OnRender() function is not called in my example page. Interestingly 10 days before, OnRender() was called for site pages (but not for list pages) with original "Custom Script" settings. The OnInit() method is always called, so I don't think this is related to provisioning issues.

I've got the same issue - and it's not fixed by allowing custom scripts tenant wide .

On some modern UI pages i get an error in the console stating:

Error: definePlaceholders() was called with an unsupported name: PageHeader

After the error is produced - OnInit() gets called.

I know that the previous well-known HTML element was called "PageHeader" and was later changed to "Top".

Not sure if it related, but i think its worth mentioning.

I finally got a developer tenant via promo email from Office Dev Program o365dev@microsoft.com

I can confirm that OnRender() does not work for a new developer tenant, new communication site, with the @ microsoft/generator-sharepoint 1.1.3 hello world extension

Closing this as it is a known issue and the API is no longer supported. Please use RC0 which was released today.

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

Related issues

jonthenerd picture jonthenerd  路  3Comments

thechriskent picture thechriskent  路  3Comments

nanddeepn picture nanddeepn  路  3Comments

christianbueschi picture christianbueschi  路  3Comments

byrongits picture byrongits  路  3Comments