Refused to execute script because its MIME type ('text/html') is not executable

Hey, I deployed my next.js site with clerkdev authentication on cloudflare. I get this error in console only when user is logged in. Failed to load resource: the server responded with a status of 404 () Refused to execute script from 'https://[mydomain]/_next/static/chunks/webpack-0342d472777da1c1.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. So, once the user is log in, instead of sign in button, I show sign out button, but the signout button is not visible to user and I get this error. Locally, the code is working perfectly. Strangely, I also have other site deployed on cloudflare with similar code & I get no error there.
4 Replies
reavatar
reavatar15mo ago
Fixed: I changed all package version to my previous project and it started working.
James
James15mo ago
When you say you changed package versions to fix it, do you mind if I ask which versions specifically you changed?
reavatar
reavatar15mo ago
I changed all, so don't specifically know the exact cause. I could be either clerk or nextjs I think. Below ones are working
"dependencies": {
"@clerk/nextjs": "^4.19.1",
"@types/node": "20.2.5",
"@types/react": "18.2.8",
"@types/react-dom": "18.2.4",
"eslint": "8.42.0",
"eslint-config-next": "13.4.4",
"next": "13.4.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"typescript": "5.1.3",
},
"devDependencies": {
"autoprefixer": "^10.4.14",
"postcss": "^8.4.24",
"tailwindcss": "^3.3.2"
}
"dependencies": {
"@clerk/nextjs": "^4.19.1",
"@types/node": "20.2.5",
"@types/react": "18.2.8",
"@types/react-dom": "18.2.4",
"eslint": "8.42.0",
"eslint-config-next": "13.4.4",
"next": "13.4.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"typescript": "5.1.3",
},
"devDependencies": {
"autoprefixer": "^10.4.14",
"postcss": "^8.4.24",
"tailwindcss": "^3.3.2"
}
NODE_VERSION=19.9.0 on cloudflare
Catt0s
Catt0s15mo ago
I had a similar issue. I don't remember exactly what fixed it, but I think it was related to my script not compiling, having an error, or being named wrong or something. Might be unreated, i don't know JS well
Want results from more Discord servers?
Add your server