sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

[Updated] SpFx Extensions OnRender() is no longer called on previously functional tenants

Open pdemro opened this issue 9 years ago • 7 comments

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

pdemro avatar Aug 25 '17 16:08 pdemro

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

  • Dev tenant instructions - https://dev.office.com/devprogram
  • Trial tenant
  • Office 365 Demos - https://demos.microsoft.com/

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

pdemro avatar Aug 28 '17 14:08 pdemro

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.

trafassel avatar Aug 29 '17 09:08 trafassel

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.

ThomasGranheim avatar Aug 29 '17 13:08 ThomasGranheim

I finally got a developer tenant via promo email from Office Dev Program [email protected]

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

pdemro avatar Aug 29 '17 17:08 pdemro

The SPFx Extensions RC0 has just landed and this is one of the breaking changes.

https://dev.office.com/blogs/sharepoint-framework-extensions-rc0-now-available

https://github.com/SharePoint/sp-dev-docs/wiki/Release-Notes---Extensions-RC-Drop-1.2

rgylesbedford avatar Aug 29 '17 17:08 rgylesbedford

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

GrahamMcMynn avatar Aug 29 '17 18:08 GrahamMcMynn

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

msft-github-bot avatar Jan 29 '20 00:01 msft-github-bot