MIME issue

Hello everyone, I am facing issue after proxying a route checkoutv2 on cloudflare. The application is on next JS. A chunck JS file is returning HTML in response. here is the error : Refused to execute script from 'https://kapiva.in/_next/static/chunks/pages/checkoutv2-571404f0c18e2fed.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. Please help here.
Checkoutv2
Checkout | Development
4 Replies
James
James14mo ago
Please can you check that you don't have caching enabled on top of pages and try purging your zone's cache?
Sanjay
SanjayOP14mo ago
@Better James I tried purging cache. Nothing seems working. Anything else that we can do here?
No description
James
James14mo ago
If purging your zone's cache doesn't fix it, I'm not sure. The people I've seen report this in the past have had success by purging cache. I would also note that caching on top of pages isn't advised, which might be why the problem arose
toni.sharpe.brainstem
I have just fixed this problem by updating the the homepage key in the package.json file from the root of the build src, ie. the top level where you will find the src/ folder in the case of Create React App un-ejected. I had that field set to a github pages URL, so I am guessing (dev-ops not really my skillset anymore) that something in CloudFlare was looking at that, hence others mentioning 404 errors. Changing that value to my CloudFlare home page _____.pages.dev fixed the problem. If you are more experienced in dev-ops and want to supercede my answer, please do so. Example:
// ./package.json

{
"name": "gui",
"homepage": "https://YOUR_PROJECT_NAME.pages.dev/",
"version": "1.0.0",

...
}
// ./package.json

{
"name": "gui",
"homepage": "https://YOUR_PROJECT_NAME.pages.dev/",
"version": "1.0.0",

...
}
Want results from more Discord servers?
Add your server