Share via

SPFx Loading Multiple Extensions in One Package

Anonymous
2023-05-12T05:41:34+00:00

I have been unable to build a SPFx package with multiple application customizer extensions to load. No matter what I do, I can only get the first extension I created to load from the app catalog. I can get the second extension to load from localhost by targeting the ID in the query string parameter so I know it is working.

There are two extensions, ext1 and ext0002.

I've updated the config.json, ClientSideInstance.xml, and elements.xml files. I've updated the version number. What am I missing? Can I have two application customizer extensions in the same package.

config.json

  "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json",
  "version": "2.0",
  "bundles": {
    "ext-1-application-customizer": {
      "components": [
        {
          "entrypoint": "./lib/extensions/ext1/Ext1ApplicationCustomizer.js",
          "manifest": "./src/extensions/ext1/Ext1ApplicationCustomizer.manifest.json"
        }
      ]
    },
    "ext-0002-application-customizer": {
      "components": [
        {
          "entrypoint": "./lib/extensions/ext0002/Ext0002ApplicationCustomizer.js",
          "manifest": "./src/extensions/ext0002/Ext0002ApplicationCustomizer.manifest.json"
        }
      ]
    }
  },
  "externals": {},
  "localizedResources": {
    "Ext1ApplicationCustomizerStrings": "lib/extensions/ext1/loc/{locale}.js",
    "Ext0002ApplicationCustomizerStrings": "lib/extensions/ext0002/loc/{locale}.js"
  }
}

ClientSideInstance.xml

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <ClientSideComponentInstance
        Title="Ext1"
        Location="ClientSideExtension.ApplicationCustomizer"
        ComponentId="b475345a-0c8e-4fb4-a573-ebd8f2afa93b"
        Properties="{&quot;testMessage&quot;:&quot;Test message&quot;}">
    </ClientSideComponentInstance>
    <ClientSideComponentInstance
        Title="Ext0002"
        Location="ClientSideExtension.ApplicationCustomizer"
        ComponentId="ec173c11-b50f-44a0-bd4a-2a0fee895278"
        Properties="{&quot;testMessage&quot;:&quot;Test message&quot;}">
    </ClientSideComponentInstance>
</Elements>

elements.xml

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction
        Title="Ext1"
        Location="ClientSideExtension.ApplicationCustomizer"
        ClientSideComponentId="b475345a-0c8e-4fb4-a573-ebd8f2afa93b"
        ClientSideComponentProperties="{&quot;testMessage&quot;:&quot;Test message&quot;}">
    </CustomAction>
    <CustomAction
        Title="Ext0002"
        Location="ClientSideExtension.ApplicationCustomizer"
        ClientSideComponentId="ec173c11-b50f-44a0-bd4a-2a0fee895278"
        ClientSideComponentProperties="{&quot;testMessage&quot;:&quot;Test message&quot;}">
    </CustomAction>
</Elements>

Ext1ApplicationCustomizer.manifest.json

{
  "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-extension-manifest.schema.json",

  "id": "b475345a-0c8e-4fb4-a573-ebd8f2afa93b",
  "alias": "Ext1ApplicationCustomizer",
  "componentType": "Extension",
  "extensionType": "ApplicationCustomizer",
  "version": "*",
  "manifestVersion": 2,
  "requiresCustomScript": false
}

Ext0002ApplicationCustomizer.manifest.json

{
  "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-extension-manifest.schema.json",

  "id": "ec173c11-b50f-44a0-bd4a-2a0fee895278",
  "alias": "Ext0002ApplicationCustomizer",
  "componentType": "Extension",
  "extensionType": "ApplicationCustomizer",
  "version": "*",
  "manifestVersion": 2,
  "requiresCustomScript": false
}
Microsoft 365 and Office | SharePoint | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2023-05-12T06:03:47+00:00

    Dear Joseph Jang,

    Good day!!

    I understand your concern but since it's related to SPFx, I would like to suggest you post your concern in related Microsoft Community i.e., Microsoft Q&A Community: SharePoint Server Development - Microsoft Q&A with SharePoint Development tag to get the detailed help from the experts.​​Sorry for redirecting you to a different community as members in this community focus on the out of the box concerns of SharePoint Online and moderator in this community are limited with coding knowledge;  So, to get fast & better assistance, we redirected you in the right direction.

    Thanks for understanding and if you feel my reply helped to guide you in right direction, please click on the helpful button (Yes or No) in the reply. In the future, if you have any further concerns related to Office 365, please feel free to post a new thread in this community and we will try our best to assist you.

    Have a good day!!

    Best Regards,

    Sophia​

    Was this answer helpful?

    0 comments No comments