Upload Failure of SPPKG File to App Catalog – Object Reference Error (Manual & CI/CD)
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
None
What browser(s) / client(s) have you tested
- [ ] 💥 Internet Explorer
- [x] 💥 Microsoft Edge
- [x] 💥 Google Chrome
- [ ] 💥 FireFox
- [ ] 💥 Safari
- [ ] mobile (iOS/iPadOS)
- [ ] mobile (Android)
- [ ] not applicable
- [ ] other (enter in the "Additional environment details" area below)
Additional environment details
- browser version
- SPFx version 1.11.0 & 1.20.1
- Node.js version 10.22.0 & 18.20.2
- etc
Describe the bug / error
We are currently encountering an issue specifically in an existing site collection where the SPFx solution is already installed, while attempting to upload the same(replace) .sppkg package(after upgrade/same package) to its App Catalog.
Site URL: https://"
The upload consistently fails with the following error:
PowerShell Error: Object reference not set to an instance of an object
Azure DevOps Deployment Error: TypeError: Cannot read properties of undefined (reading 'IsClientSideSolutionCurrentVersionDeployed')
Steps Already Tested:
Verified the .sppkg package by successfully uploading it to other site collections and the tenant-level App Catalog — confirming the package is valid.
Attempted uploading using multiple methods:
Manual upload via browser
Azure DevOps CI/CD pipeline using PowerShell and PnP PowerShell
Local SPFx Gulp tasks
Steps to reproduce
- Build .sppkg with same existing code.
- Upload package to site where the same package is already exist.
- Encounter the "Object reference not set to an instance of an object" error.
- Failed to upload & deploy the package.
Expected behavior
It should replace the old package with new package which has different version with same logic.
Hello @SuriM92, Thank you for bringing this issue to our attention. We will look into it and get back to you shortly.
@SuriM92
I’ve tested the same scenario on my side by re-uploading an existing .sppkg package (both with updated and same version) to a site collection app catalog, and I was able to replace it successfully without encountering any errors. Based on this, it doesn’t appear to be a product bug, but more likely a configuration or environment-specific issue.
I am trying to update the old .sppkg file with new one different version, its giving me an error. Note: I am able to add after deleting old one.
Thanks for your comment, @Ashlesha-MSFT . I have an old .sppkg file that was working fine two months ago. Could you please help me understand what configuration issues might be causing problems now?
@SuriM92, Thank you for your detailed response.
Since the package uploads successfully after deleting the existing one, and works in other app catalogs, it does appear that the issue is specific to this particular site collection app catalog. This kind of error (Object reference not set to an instance of an object) is often caused by inconsistencies or corruption in the app catalog or legacy metadata associated with the existing package.
Here are a few common causes and suggestions to consider:
Corrupted existing entry: The older version of the package might be in a partially deployed or inconsistent state. Deleting and re-uploading (as you've done) typically resolves this.
Version conflict or caching: Sometimes, SharePoint may not recognize changes if only the version number is updated without structural changes. Try incrementing the solution version in the package-solution.json and also the package version in your web part’s package.json.
@Ashlesha-MSFT , thanks for your quick response. I tried changing the version in both the package.json and package-solution.json files, but I'm still encountering the same error. If I delete and re-add the web part, will it affect the pages where the web part is already added?"
@SuriM92, Based on my experience, yes — deleting the app from the app catalog will remove the solution, and any web parts added from it will stop working until the app is re-added.
However:
If you replace the app (without deleting), the existing web parts on pages should remain intact and continue to function. If you delete and re-add the app, you may need to re-add the web part to pages, depending on how it's referenced and deployed.
Hello,
For your information, we've been reproducing exactly the same error for several packages over the past few days.
We produce several packages that we deploy in our customers' App Catalogs. Many customers are affected by these deployment errors (impossible to know why some have the problem and others don't). The symptoms are the same and the conditions are the same as those described in this issue. The only difference is that Tenant App Catalogs are also affected.
We're supposed to be deploying several versions a week to our customers, but we're stuck with this error for about 10 days. And it's impossible for us to delete our packages for fear that it would be impossible to re-upload them and all our customers' SharePoint sites would become unusable.
Hello, Given the growing number of affected developers and tenants, we believe this may point to a regression or validation issue on the SharePoint platform side, especially considering that previously functional packages now fail unexpectedly. We are raising bug with the engineering team internally and will share updates here as soon as possible. Thank you for your patience!
@Ashlesha-MSFT Thanks for confirming the issue,, I’ve already raised a support ticket with Microsoft on July 3rd regarding this issue. If needed, I can share the ticket number.
This issue should be resolved now - I would very much appreciate your verification / confirmation (please gimme a thumbs up on this message :-)
This issue should be resolved now - I would very much appreciate your verification / confirmation (please gimme a thumbs up on this message :-) @PiotrekKrakowiak It's working now — thank you for the update. It would be helpful to know what caused the issue and what the fix was.
Thank you very much @PiotrekKrakowiak , the issue is “partly” solved.
Nevertheless, two remarks:
- deployments have become very, very slow for some site App Catalogs
- Sometimes a new error appears:
Exception from HRESULT: 0x80131904
Example for a customer deploying to 18 specific sites App Catalogs:
- Total deployment took 38'40s just to connect to the sites + deploy the package (before the bug, it took about 5 minutes)
- On the 18 targeted sites :
- 11 are successful
- 7 are in error:
Exception from HRESULT: 0x80131904
thx @PiotrekKrakowiak on the update from internal sources. Thanks for confirming the fix for the specific issue @umashankar-padhan.
@jbolliet-mozzaik365 - that seems to be an issue on the app catalog, but not the specific issue which was defined in the original submission. To ensure that we can track the issues also internally, please submit a new issue if this is still happening. That will help our internal processes to help you in fastest possibl way.
Thanks everyone on reporting these - highly appreciated.