Sp-dev-docs: Error moving from site page to library: Error information is 'expectingBaseExtension'.

Created on 24 Aug 2020  Â·  22Comments  Â·  Source: SharePoint/sp-dev-docs

Category

  • [x] Bug

Describe the bug

When moving between a site page and library using the left (team) or top (communication) site nav, a Client Side Extension Application Customer fails to load properly.

Steps to reproduce

Create the extension

  1. Create a brand new Application Customizer
  2. https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/build-a-hello-world-extension
  3. Include client side assets
  4. Do not allow tenant deploy
  5. In onInit, add a console log to verify it's successfully loading.
  6. Create a production .sppkg file.
  7. Upload the .sppkg to the app catalog of a SharePoint Online tenancy (I'm using First Release but I believe this happens in standard as well).

image

Test the extension

  1. Create a modern Team site.
  2. Add the extension to the site.
  3. Open the developer tools Console
  4. Open the site Home page
  5. Verify the console message appears.
  6. Click Documents in the left nav
  7. Note the error:

Uncaught (in promise) Error: Failed to create application customizer 'ClientSideExtension.ApplicationCustomizer.'. Error information is 'expectingBaseExtension'.

image

Expected behavior

The customizer reloads properly.

Environment details (development & target environment)

The customizer does not reload properly and additional errors and issues may appear in the page depending on what the extension is expected to to.

  • Your Developer Environment:
    > - Windows 10
  • Target Environment:
    > - SharePoint Online
  • Framework:
    > - N/A
  • Browser(s):
    > - Chrome v84
    > - Edge v84
    > - Firefox v79
  • Tooling:
    > - VS Code 1.48.0 | SPFx v1.11.0
  • Additional details:
    > - The same issue happens with a Communication site that has the Documents library in the site nav.
    > - Reloading the library page or copying the URL and pasting it into the address bar properly loads the extension.
    > - The issue does not occur if you have a Hero web part where a tile points to the Document library.
    > - Moving from a library page to a site page does not trigger the issue.
    > - Moving from a site page to another site page does not trigger the issue.
    > - Moving from a library page to another library page does not trigger the issue.

Additional context

  • We use the extension to provide Analytics tracking of interactions with SharePoint pages. This issue causes tracking to be lost after moving from a site page to a library, or vice versa.
spfx-extensions spfx-in-lists working-on-it bug-confirmed

Most helpful comment

The fix for this has been checked in and will be rolling out across the service over the next week.

All 22 comments

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

I am having the same problem going from site page to list. Seems to have happened about the time the New Item button became a colored button. Simple refresh of page fixes the issue as long as you never go back to a site page.

listview-host-assembly_default_4208c255300223c76f3e1ea8ae09d6d1.js:1 Uncaught (in promise) Error: Failed to create application customizer 'ClientSideExtension.ApplicationCustomizer.f204eb2a-2d53-4086-9a77-cb1d5916bcd2'. Error information is 'expectingBaseExtension'.
at listview-host-assembly_default_4208c255300223c76f3e1ea8ae09d6d1.js:1
at async Promise.all (index 0)

Same problem. Custom command and activates on selecting a folder or a document. Refreshing solves the problem but not all the time. Gives below error.

Uncaught (in promise) Error: Failed to create application customizer 'ClientSideExtension.ApplicationCustomizer.1a380c38-73c4-4afb-9c91-c4eba9ccda58'. Error information is 'expectingBaseExtension'.
at listview-host-assembly_default_4208c255300223c76f3e1ea8ae09d6d1.js:1
at async Promise.all (index 0)

e.prototype._createApplicationCustomizer = function(t) {
var n = this
, r = new s._QosMonitor("ApplicationCustomizer.Create");
return this._extensionManager.createExtension(t.clientSideComponentId.toString(), t.clientSideComponentProperties, function(e) {
return tt.delayExtensionsLoading ? n._applicationCustomizerContextFactory.getApplicationCustomizerContext(t) : n._applicationCustomizerContextFactory.createApplicationCustomizerContext(t, e, !1)
}).then(function(e) {
return r.writeSuccess(n._createQosExtraData(t)),
e
}).catch(function(o) {
v_ar i = new Error("Failed to create application customizer '" + t.tag + "'. Error information is '" + o.message + "'.");_
throw r.writeExpectedFailure("FailedCreateExtension", o, n._createQosExtraData(t)),
s._TraceLogger.logError(e._logSource, i),
i
})
}
ApplicationCustomizer_Error

There was another problem related to the application customizer navigated event no firing or firing too early that prevent detection of a new page. That problem may have been fixed with the update that inserted this bug. Not sure if they are related. I have a bit more testing to do, but I am no longer seeing a problem associated with the navigated event as long as I never go to a site page.

Our issue has to do with the list view customizer and it suddenly stopped working. Did an upgrade to the latest spfx framework and updated all outdated packages still unless you refresh the command won't launch with the error.

I am aware of an issue with navigatedEvent firing twice if you are on a Communication site and use the top nav to go to another site. I should probably file an additional defect for that, now that I've narrowed down the reproduction steps.

But as sabarinadh, this isn't about the navigatedEvent.

SP engineering is aware of this & actively working it... will post more if/when I learn more

Most likely related to this issue: We are seeing that the pageContext object in our appcustomizer is not getting updated when navigating from a page to a list which breaks our solution.
Sometimes the navigatedEvent triggers twice. The second time the pageContext is correct.

Sometimes it never triggers.

Get Outlook for iOShttps://aka.ms/o0ukef


From: Oliver Zeiser notifications@github.com
Sent: Friday, August 28, 2020 9:23:51 AM
To: SharePoint/sp-dev-docs sp-dev-docs@noreply.github.com
Cc: Jeffrey Childers jchilders@rumphchilderslaw.com; Comment comment@noreply.github.com
Subject: Re: [SharePoint/sp-dev-docs] Error moving from site page to library: Error information is 'expectingBaseExtension'. (#6198)

Most likely related to this issue: We are seeing that the pageContext object in our appcustomizer is not getting updated when navigating from a page to a list which breaks our solution.
Sometimes the navigatedEvent triggers twice. The second time the pageContext is correct.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com/SharePoint/sp-dev-docs/issues/6198#issuecomment-682569383, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACWWN2I5MQFTJB6GMGT6RFTSC6VWPANCNFSM4QJ6PUBQ.

Any estimate on when this will get fixed? I so wished the spfx platform was more reliable...

Rough approximate timeline would be good so we can set expectations for the business. Asking them to do a workaround may not solve work for the long term.

Any updates on this?

Feeling the pressure of using open source 💯. This should have been broken in so many environments and wondering how people are dealing with it.

This is very critical for us. @VesaJuvonen, @patmill, @andrewconnell, can you say anything new about progress on this issue? It's pretty annoying that such major bugs appear and they are not fixed quickly - in my eyes it makes SharePoint Framework not reliable enough and too often we have to make excuses to our customers by saying "it's Microsoft's fault".

_FYI - I'm not Microsoft, so it's not my place to speak for them on the status of the issue..._

The fix for this has been checked in and will be rolling out across the service over the next week.

Also - I want to confirm / clarify one thing, as there have been some other bugs logged in our system that seem to be based on a misunderstanding of what should be happening here.

OnInit fires once per extension load. If you swap from site to site, page to page, or page to list / list to page, and there is a "fast" navigation, OnInit will not fire.

If you need things to happen on every page navigate, you need to hook into the onNavigate event
this.context.application.navigatedEvent.add(this, () => { //your function; });

. Elio has a nice blog post about it here - https://www.eliostruyf.com/handling-navigation-in-a-sharepoint-framework-application-customizer/ . His solution is a bit brute-force, where every navigate event does a full placeholder render, but you can get the idea.

Thanks, @patmill. Should we temporarily put the solution in place or can we wait for a fix (if it is going to be rolled out soon).

@patmill should the issue be fixed now? Because the issue with the pageContext still exists for me. When I navigate from a page to a list, the pageContext is not correct unless I do a full page reload. So to be more exact, when navigating to a list in an application customizer, this.context.pageContext.list is undefined.
Also when navigating back and forth between two libraries, the navigatedEvent you mentioned above does not trigger at all at some point.

@patmill I need some clarification in regards to when a OnInit for a ListViewCommandSet Extenstion should fire. Previously it would run when navigating to the list where the extension is enabled. It does not do that anymore.
The following is what is happening in our scenario:
A user loads a 'normal' page, the Extension is not loaded and therefore the OnInit is not triggered.
The user navigates to the list where the Extensions is installed. The extension is loaded but the OnInit is not triggered.

We can not add the navigation event listener when the OnInit is never triggered.
The only way the OnInit is triggered is if the user reloads the list page

@OliverZeiser - The fix is rolling out this week (we found a group of issues in this area last week across a couple of teams that were focused on), so it will depend on when it reaches your particular farm / tenant.
@espen-fossum = "The extension is loaded but the OnInit is not triggered" - are you saying that the extension doesn't execute (and your command set isn't present), or that it is present, but onInit isn't called? Also, the navigation event listener doesn't exist on a command set, only an application customizer. Not sure exactly what you are doing.

@patmill The code is loaded but the OnInit is not triggered when navigating from another page. The workaround i found was to use 'data-interception="off"' on the anchor element linking to the list from our page. This circumvents the "fast" navigation and the OnInit it triggered.

I only mentioned the navigation event listener in response to what you said about OnInit not firing when navigating, We are not using or trying to use the event listener in our command set extension. We are only trying to get the command set extensions OnInit to trigger when navigating to the list.

Was this page helpful?
0 / 5 - 0 ratings