question

Toriyama avatar image
0 Votes"
Toriyama asked RaytheonXie-MSFT commented

Are There Cache Issues When Updating an SPFX Web Part?

I have noticed that when I update the SPFx Web Part in the productive environment, it takes a long time to synchronize the new version.
It keeps changing the new version with the old one. Time is the new version, time the old.
How to solve this?
Thanks

sharepoint-devoffice-sharepoint-server-development
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

RaytheonXie-MSFT avatar image
0 Votes"
RaytheonXie-MSFT answered RaytheonXie-MSFT commented

Hi @Toriyama ,
In fact, any SharePoint Framework project has two different kinds of versions. The more project oriented version number is stored in the ‘package.json’. The web part related is stored in the ‘package-solution.json’ inside the config folder.
Both are valid versions of your project, but they are not in sync and needs to be updated individually. For SharePoint you can update the package-solution file. For the overall project you update the ‘package.json’ in the root folder.
Currently there is no tooling support available that allows you to update the version of your web part solution file. You can update the version number manually by editing the ‘package-solution.json’.
You can make a reference to the document
https://docs.microsoft.com/en-us/sharepoint/dev/spfx/toolchain/update-latest-packages


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.




· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @Toriyama ,

I am checking to see if the problem has been resolved. If you have any questions or progress, you can contact me in time.

0 Votes 0 ·
Toriyama avatar image Toriyama TongZhangMSFT-7548 ·

Hello, TongZhangMSFT-7548.

I haven't published new package yet. When I publish I will understand this.
Thanks

0 Votes 0 ·

Hi RaytheonXie-MSFT.
How are you?

I looked at my project and we have:
In package.json

"name": "SPFX solution",
"version": "0.0.1",

And in package-solution.json we have:

"name": "SPFX solution-client-side-solution",
"version": "2.0.0.0",

Is it correct to have the same value in version?

Another thing I noticed is that the name is not the same in name.

Maybe with each deploy it would be better to always remove the solution from the site instead of updating?

Thanks for the support.

0 Votes 0 ·

Hi @Toriyama ,
package-solution.json contains solution path configurations. And package.json defines JavaScript library dependencies. It's common that they have different name and version.

0 Votes 0 ·

Hi @Toriyama ,
Would you tell me whether your issue has been resolved or have any update?
I am looking forward to your reply.

Have a nice day!

Thanks,
Raytheon Xie

0 Votes 0 ·

Hi @Toriyama ,
would you please provide us with an update on the status of your issue?

0 Votes 0 ·