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

SPFx extensions not working in Sharepoint Modern list default pages

Open srisspfx opened this issue 7 years ago • 14 comments

Category

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

Expected or Desired Behavior

Hi Team,

We have created a SPFx extension with Top and Bottom placeholders. Both these placeholders have data manipulations which is fetched from external js file(loaded through SPComponentLoader inside Init method) uploded in the same SIte Collections. After deploying and adding the app across Site Collection,the extensions are working fine across Site Pages. But when we tried creating a new Sharepoint list with Modern Experience, the Top and Bottom Placeholders are not loading in the list pages(AllItems.aspx).

Any ideas on why this is happening.

Thanks for your contribution! Sharing is caring.

srisspfx avatar Apr 16 '19 11:04 srisspfx

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

msft-github-bot avatar Apr 16 '19 11:04 msft-github-bot

@srisspfx says:

Any ideas on why this is happening.

Not without having more context (SPFx version used), browser, SharePoint environment & seeing some code... can you provide some additional context?

andrewconnell avatar Apr 16 '19 13:04 andrewconnell

Sounds like it may be related to https://github.com/SharePoint/sp-dev-docs/issues/2779

The root cause on that was the application extension wasn't properly interacting with the placeholders. Due to using an older method of interaction. Updating to use: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/using-page-placeholder-with-extensions instead fixed the issue

MaartenSundman avatar Apr 16 '19 17:04 MaartenSundman

Sorry - misread the thread. I thought Maarten was saying he fixed his code and the bug was gone, not that he solved it, so srisspfx might try the same thing.

patmill avatar Apr 16 '19 20:04 patmill

@srisspfx says:

Any ideas on why this is happening.

Not without having more context (SPFx version used), browser, SharePoint environment & seeing some code... can you provide some additional context?

Hi Andrew,

Tried logging in console after the promise, below is the error that we are getting.

image

NOTE: We have noticed that the placeholder is loading properly, but components loaded through SPComponentLoader doesn't work. This is happening only in List pages and not on Site Pages.

Thanks in advance.

srisspfx avatar Apr 17 '19 07:04 srisspfx

@srisspfx Can you provide a link to a GH repo that has a minimal repo of the issue? Would make for evaluating this as a bug a lot easier...

andrewconnell avatar Apr 17 '19 19:04 andrewconnell

This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within next 7 days of this comment. Thank you for your contributions to SharePoint Developer activities.

msft-github-bot avatar Apr 24 '19 20:04 msft-github-bot

HelloWorldApplicationCustomizer.txt

Above is the source code for .ts file.

Its not passing beyond the below code: SPComponentLoader.loadScript("https://ABC.sharepoint.com/sites/uatModern/SiteAssets/Modern/jquery-3.3.1.min.js") So it fails to load the jquery plugin, because of which, none of the subsequent js files are loaded.

Thanks.

srisspfx avatar Apr 25 '19 09:04 srisspfx

This happens only when we open the Modern list page(AllItems.aspx). If i create a normal Modern SitePage, its executing all .js files successfully.

srisspfx avatar Apr 26 '19 06:04 srisspfx

any updates on the issue why it is happening?

srisspfx avatar May 03 '19 06:05 srisspfx

According to the 1.8.2 release notes out today it appears MSFT is aware and "working on it"

andrewconnell avatar May 07 '19 21:05 andrewconnell

@srisspfx - sorry for the super slow response here. We just got around to looking at this and it appears that it is no longer reproing (on a list I am able to load a placeholder which in the oninit function calls SPComponentLoader.loadScript("https:///SiteAssets/Modern/jquery-3.4.1.min.js") and then have the promise resolve). Are you still seeing this issue?

GrahamMcMynn avatar Oct 11 '19 23:10 GrahamMcMynn

This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within next 7 days of this comment. Thank you for your contributions to SharePoint Developer activities.

msft-github-bot avatar Oct 19 '19 00:10 msft-github-bot

Closing issue due no response from original author. If this issue is still occurring, please open a new issue with additional details. Notice that if you have included another related issue as additional comment on this, please open that also as separate issue, so that we can track it independently.

msft-github-bot avatar Oct 26 '19 00:10 msft-github-bot