pnp/sp-dev-fx-extensions

I have deployed the solution to tenant and i could not look up the extension to add it to the site collection (Deployed tenant wide with no errors)

Opened this issue · 6 comments

Sample

SPFx Toastr Application Customizer

Author(s)

@thechriskent

Question

I was trying to add this SPFx Toastr Application Customizer extension to my tenant and i have deployed it successfully but i was not able to add the extension to the SPO site collection. Read me notes have custom actions to add the custom list and extension to the site. when i am trying to add the custom actions to site to add the extension i am getting this error. Not sure where the issue is
SPFX ERROR

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

Hi @88naveen! Thanks for working with my sample!

I'm a little confused as to where you are getting the error you've shown. The package goes in the app catalog and then deployment (if using the included assets) are done via PowerShell and there shouldn't be any Javascript involved.

Could you provide a little more detail about exactly which part you are running and from where? Thanks!

Hi @thechriskent

So I have build the solution and uploaded the .sppkg file to app catalog, once I deployed this tenant wide while i was trying to add the extension to SharePoint Site Collection I am not able to see the extension in site contents -> your apps and so i was trying to add it via your custom actions

Connect to your site (login when prompted):

spfx-ext --connect "https://yourtenantsharepointcom/sites/yoursite" at this point i am getting this error

next step

Add the extension:

spfx-ext add "Toastr Notifications" ApplicationCustomizer site a861c815-e425-416d-9520-04bcdf557e27

PS C:\demodev\jquery-application-toastr> spfx-ext --connect "https://domain.sharepoint.com/sites/demoapp"
C:\Users\User\AppData\Roaming\npm\node_modules\spfx-extensions-cli\node_modules\node-sp-auth\lib\src\auth\resolvers\ondemand\OnDemand.js:83
let cookiesJson = cookieData[1].split(';#;');
^

TypeError: Cannot read property '1' of null
at OnDemand.saveAuthData (C:\Users\User\AppData\Roaming\npm\node_modules\spfx-extensions-cli\node_modules\node-sp-auth\lib\src\auth\resolvers\ondemand\OnDemand.js:83:37)
at OnDemand.getAuth (C:\Users\User\AppData\Roaming\npm\node_modules\spfx-extensions-cli\node_modules\node-sp-auth\lib\src\auth\resolvers\ondemand\OnDemand.js:39:28)
at Object.getAuth (C:\Users\User\AppData\Roaming\npm\node_modules\spfx-extensions-cli\node_modules\node-sp-auth\lib\src\index.js:8:76)
at Object. (C:\Users\User\AppData\Roaming\npm\node_modules\spfx-extensions-cli\dist\index.js:94:20)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

This appears to be a bug with the SPFx-extensions-cli. Unfortunately, that project is no longer maintained (hasn't had an update in 4 years).

If you are able to use the PnP provisioning assets provided that might be easier (instructions and templates are located in the sample). Alternatively, you could give the CLI for Microsoft 365 a try.

You can login with:

m365 login

Then you can deploy the custom action with:

m365 spo customaction add --url https://yourtenant.sharepoint.com/sites/yoursite --title "Toastr Notifications" --name "{2e5829db-79d3-4385-89f0-3258207a8aba}" --location "ClientSideExtension.ApplicationCustomizer" --clientSideComponentId a861c815-e425-416d-9520-04bcdf557e27

There are instructions for adding the backing list manually.

Thank you I was able to deploy the list and also the Toastr notifications app to the site collection and added the required notification details in the list but I could not see any notifications on the site. I am i missing anything?