BaseApplicationCustomizer throws errors

48 Views Asked by At

So today I was updating one of our SPFX extensions to use the latest spfx framework (1.16) with node (16.13) and after finishing my updates I got the following inside my code: enter image description here I am not exactly sure why these are not coming in, I suspect the newest version of spfx moves these classes out of sp-application-base, but why? and where is the documentation for it? Because there is this link that is only 6 months old and explains to use this code for the top and bottom headers.

I was expecting this code to remain in sp-application-base, but it appears it isn't in that package.

2

There are 2 best solutions below

0
Don Kirkham On BEST ANSWER

How did you perform the upgrade? I highly recommend using the Microsoft 365 CLI to upgrade projects, as the developers of that app do thier best to cover every part of the project that needs to change. Learn more at https://pnp.github.io/cli-microsoft365/cmd/spfx/project/project-upgrade/

Here are the commands to run from the root of your project

npm install -g @pnp/cli-microsoft365
m365 spfx project upgrade --output text

This will give a list of npm commands and code update instructions to follow. See the above documentation for other options for output and use whatever works best for you.

1
langsky On

It is still there. What version of @microsoft/sp-application-base is in your project? Should be 1.16.1 I believe. I will say that I am new to all of this as well, but I am using the latest framework and VS is not flagging any issues with these.