Are There Cache Issues When Updating an SPFX Web Part?

Toriyama 286 Reputation points
2022-05-10T11:01:02.247+00:00

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 Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,204 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,629 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 37,866 Reputation points Microsoft Vendor
    2022-05-11T02:29:43.17+00:00

    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://learn.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.



Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.