Search code examples
spfxspfx-extension

BaseApplicationCustomizer throws errors


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.


Solution

  • 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.