"Failed to load script module" for some regions after deploy

I’ve been deploying a web application on Azure and I’m using Cloudflare DNS with proxy. After each deploy, I got users complaining that they can’t access the website. After some investigation, I found out:

  • Users that can’t access the website get a blank page
  • Their console is showing Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". when loading the main JS file. Comparing it to my network, it is trying to fetch the correct/updated JS file (every new build has a different JS file name).
  • The response they’re getting for that file is the index.html with a 404.
  • Most affected users seem to be located in US West. Rest of the world is fine AFAIK.
  • The web application (Azure) is deploy in Canada East.
  • After some time the issue is gone.
  • If we “purge cache” on Cloudflare the issue gets solved quicker but still takes a while.

I suspect it’s an issue with propagation since it’s proxied by Cloudflare but how can I solve it? Seems like the index.html is propagated quickly but *.js isn’t? Any configuration to solve it?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.