Browser must be refreshed in order for App to load

Hello Radzen Team,

I'm looking for some guidance on solving this issue.

It has been occurring for a long time but I'm just getting around to troubleshooting it.

Issue: The user must refresh the browser page in order for the application to load properly

When the web application is first requested, the browser page is blank until the user refreshes the browser, then the application loads.

I've identified the issue is caused by the browser loading the index.html page from ngsw cache which has an outdated version of the file. The outdated version of the file references resources that no longer exist on the web server such as main.xxxx.js, styles.xxxx.css and polyfills.xxxx.js

Has anyone else run into this?

any advice on how to fix this issue?

best regards,
michael

Hi @michael,

This sounds as a one of those pesky PWA app issues. Honestly we don't know of any way to properly fix that but disable PWA completely. You can do so by opening the client\src\app\app.module.ts file and commenting (or deleting) this line:

environment.production ? ServiceWorkerModule.register('ngsw-worker.js') : [],

I may have found the solution. still testing. but it looks as if the ngsw-config.JSON file was from an older version of Radzen and was not getting updated. I replaced it with the latest version and it appears to have fixed the issue.

thanks,
michael