0

I am currently trying to find out how to fix this behavior. I got some SPFx Webpart samples and when I update them and re deploy them to the Tenant's app catalog, the sites that use it automatically use the newest version without the need to go in the site contents and update it manually with the "Get It" button.

The webparts I have created do not have this behavior, I need to go update them on all sites that use it and I can see this becoming tedious in the future.

I have tried to compare the code from my package-solution.json with the code from sample webparts but everything seems really similar.

Here is the steps I do when I want to publish a new package.

  • Increment the version number in package-solution.json
  • Run the following commands gulp clean gulp build gulp bundle --ship gulp package-solution --ship
  • Take the new .sppkg file and upload it to the App Catalog of the tenant
  • Go to each site and update the app manually (This is the step I would like to avoid)

I am still pretty new to SPFx development so any help is appreciated. I have tried to look online but couldn't find what I am looking for.

1 Answer 1

0

Inside the package-solution.json file there is a version property. If that property gets updated, it'll trigger a prompt to upgrade for each site. If you deploy an update without updating the version property, it'll update silently.

The github samples are updating that version property.

1
  • Should it be done programatically? Because I update it manually before I run the build, bundle and package commands and I still need to go update it manually on the sites afterwards.
    – Taranis
    Nov 2, 2023 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.