I host my react app on uberspace. They use apache and have X-Content-Type-Options: nosniff
enabled. Which I like.
However when I host my react app I get the following error in firefox console:
The resource from “url...” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
I figured out that the mimetype of the js is for some reason text/html. Saw that in network tab in the firefox developer tools.
I added AddType text/javascript js
to my .htaccess, but it doesn't help.
I think the problem is, that the js is served as html mimetype and I don't know how to force it to be mimetype js.
Any ideas? Thank you
I might be late but I solved my similar problem.
Check if the file path is correct or that the file is there.
I used SvelteKit static build and I only uplouaded the index.html file and not the _assets which contain files with new randomly generated filenames.
Reference: Resource blocked due to MIME type mismatch (X-Content-Type-Options: nosniff) dav's answer