Problem Installing SPFx app to sub sites
Category
- [x] Question
- [ ] Typo
- [x] Bug
- [ ] Enhancement / Suggestion
- [ ] Additional article idea
Expected or Desired Behavior
An SPFx Web Part is installed in a site collection. A new sub site should allow for the installation of the same web part.
Observed Behavior
There is an error when attempting to install to a subsite.
A different version of this App is already installed with the same version number. You need to delete the app from the site and the site recycle bin to install this version.
Steps to Reproduce
Install an SPFx web part to a site collection. Create a new sub site. Install the app to the sub site.
The only way I have been able to get around this is to version up the web part and redeploy it to the store.
I did encountered this issue a few times.
I too have this issue. Is this fixed?
Is there any update on this issue. We need to add multiple custom spfx web parts to sub sites and can't increment every web part each time we create a sub-site.
Same here. This is a show stopper for quite a few scenarios. I know that we're moving away from sub sites, but there are still plenty of customers that have them (I guess 99%) ...
@BigEaseGueldi Hi there, I remember we were able to resolve the issue after deleting everything and then upgrading to the latest version 1.4.1 Please refer to https://github.com/SharePoint/sp-dev-docs/wiki/Release-Notes-for-SPFx-Package-Version-1.4.1
Thanks @mchsudhakar, but in this case we started with 1.4.1. The thing is that it works for one site or sub site in a site collection, but not for more.
To clarify things a bit: Once "Add an app" has worked, the Web Part will show up (thanks to solving 775). But in this case, "Add an app" does not work in case you have added the app on another sub site within the same site collection.
Hi @nickpape-msft - Should this be fixed already? In my opinion it isn't, but maybe I'm doing something wrong here. The sub site support is essential for the classic model. Without it, SPFx will have a hard time in classic...
Thanks! Dirk
If you want to install spfx web parts for on-prem too please take a look at my blog post -> https://rasper87.wordpress.com/2018/04/26/provision-spfx-web-parts-to-classic-sites-part-3-install-spfx-web-part-to-sharepoint-site-web/
Trying to tease this apart. Here's what I have done and what I see.
Create a new solution with a webpart with 1.4.1, and upload it to the app catalog. Make sure that global deployment is not enabled. Create an SPSite with 3 subwebs sub1, sub2, and sub1/sub1 Activate the app on Sub 1. I can now add the webpart to pages in Sub1, but not Sub2, and not Sub1/Sub1 Activate the app on Sub 2. I can now add the webpart to pages in Sub2, as well as Sub1.
Are you folks seeing something different?
Is the issue that you want to add it at the root web, and have it available to all subwebs?
Yes, with my solution above you can install it programmatically (or with web template automatically) in any kind of sub webs
We are seeing the same behavior on SharePoint Online.
@saulpreciado - what exact behaviour are you seeing? Can you confirm / deny each point I mentioned in my reply?
@patmill, it's slightly different but same symptoms. We have a global solution with both extensions and web parts. What we have noticed is that when we use the solution with the extensions we are able to use the web parts only on the root site, not the sub sites. I'm not sure if there is already a thread for this particular scenario.
Sorry @saulpreciado - more clarifying questions. So you have a solution that doesn't require activation ("global deployment"). You upload the solution, and select the "make this available everywhere" in the UI when asked. You go to the root of a site collection (where you didn't activate the solution), and you can add the webpart, but when you go to a subweb, you can't?
Or did you say "doesn't require activation" in the package, but when you uploaded it, you didn't enable that, then you went to the root web of a site collection, "added the app", then could create the webpart on the root web, but not a subweb?
Still experiencing issues when deploying the app on subsites, I am using the latest version of SharePoint Framework solution 1.6.0
I had same issue, deleted the SPFX app from root site as well as all subsites under it and cleared from primary and secondary recylce bin and tried to add app it keeps throwing error "A different version of this App is already installed with the same version number. You need to delete the app from the site and the site recycle bin to install this version."
but there is no app in recycle bin as well as site collection, may I know how I can add the app again and get out of this issue?
I use SPFX 1.4.1 version
Did anyone get a solution to this? - we're still experiencing the same thing in SP Online in May 2019. We have an app customizer deployed to a Modern Communication site, but can't add it to a Team subsite. We get the same error as the OP about version numbers, saying it's already installed.
I just ran into this issue and, following this post, I changed de version in my config/package-solution.json from "1.x" to "2.0". After redeploying it, I was able to add my webpart to a subsite. I am not sure if I will be able to upgrade the version in my parent site so I would say this is rather a workaround.
@dg2000r - Just to confirm the scenario - can you answer these questions when it isn't working? 1 - Did you deploy the solution to the tenant app catalog, or does your com site have a site-collection app catalog? 2 - Does your solution support tenant wide deployment, or do you need to 'add an app' on a site to use it? 3 - Do you have anything in the /sharepoint/assets folder in your development environment? If so, what does it look like? 4 - What do you get from this API call (just type it into the browser) https://yourtenant.sharepoint.com/comsitepath/_api/web/usercustomactions ? 5 - What do you get from this API call https://yourtenant.sharepoint.com/subwebpath/_api/web/usercustomactions ?
4 and 5 would look like this for a comsite called 'comsite' with a sub site called 'subteamsite': https://contoso.sharepoint.com/sites/comsite/_api/web/usercustomactions and https://contoso.sharepoint.com/sites/comsite/subteamsite/_api/web/usercustomactions