web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Javascript web file no...
Power Pages
Answered

Javascript web file not refreshing

(1) ShareShare
ReportReport
Posted on by 96

Hi,

I created a javascript file of some common functions and added it to the portal using web files. This part is working fine. I was able to reference the functions within this javascript file.
However, any changes that I make to this javscript file do not show up on the portal pages. E.g. if I add a new function, or edit a function, I cannot see those changes. For some reason it still shows cache of old javascript. I have tried clearing the cache, clearing the config, but can't get over this issue. I even tried closing all browser windows, but the problem persists.

The only way it works is if I delete the web file record completely and create another web file with a different name, and attach the javascript file to it again.

If I delete it and recreate it with the same name, it again shows the old code.

This common functions library will keep growing, and I am running out of names for this web file 🤔 . Anybody know what I'm doing wrong ? Anyone else face the same issue ?

Categories:
I have the same question (0)
  • Verified answer
    ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @PortalNewbie 

     

    It is a known issue. The way I use to run JS files is as follows. 

     

    1. Upload a web file in portal management 

    2. Amend the file with your functions if needed. 

     

    Note: Do not change the Filename 

    3. Hit save and close 

     

    ------------
    In Portal studio

    1. Pres sync configuration and browse the website. And press "Ctrl+F5"  twice 

     

    NB: Even though the portal studio sync config is for front end changes. For some reason, Sync config is also taking portal management files into account and the hard refresh.

     

    Hope it helps. 
    ------------

    If you like this post, give it a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.

  • Verified answer
    Fubar Profile Picture
    8,487 Super User 2026 Season 1 on at

    In addition to what raga suggested I usually add a new file attachment with a different file name (e.g. add a version number to its file name) 

     

    Also, sometimes the browser can 'hold' on to its cached version of a file for too long.  You also can try to do a hard clear of the Browser - on a Portal webpage hit F12 (to open the browser debugger/console) then right click the refresh icon in your Browser and select the "Empty cache and hard refresh" option - this option only appears when you have the debugger/console open and is more effective than just a ctrl-f5.

  • Manish R Sharma Profile Picture
    96 on at

    Thank you @ragavanrajan  @Fubar . Both your solutions worked.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
rezarizvii Profile Picture

rezarizvii 53

#2
DP_Prabh Profile Picture

DP_Prabh 40

#3
oliver.rodrigues Profile Picture

oliver.rodrigues 28 Most Valuable Professional

Last 30 days Overall leaderboard