MIME type ('text/html') is not executable, and strict MIME type checking is enabled
ps://arknext.io/filament/assets/app.js?id=9cf00a680eed0bca655a7d74a5f4ce67 net::ERR_ABORTED 404
admin:1 Refused to execute script from 'https://arknext.io/filament/assets/app.js?id=9cf00a680eed0bca655a7d74a5f4ce67' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
any idea why i get this in production , im using nginx
27 Replies
this is mime.types
this only happens in chrome , firefox seems fine
JS is returned with mime type
text/html
. You probably just need to add a mime type for JSis there isn't it ?
application/javascript js;
check the default forge nginx config
because it works out of the box with all official laravel environments
is that something that is public ?
Ah, sorry. Search didn't work 🤦🏼♂️
Seems like it isn't applied properly. Did you adjust anything? If yes: Did you restart nginx?
i didn't change anything
this is the entry in the nginx.cfg
this is the forge config for demo.filamentphp.com
we havent changed anything
ok let me dig in thanks
Is this inside the
http
section?my config is pretty much the same
i found this post here
Gist
Modified Nginx configuration file for servers provisioned by Larave...
Modified Nginx configuration file for servers provisioned by Laravel Forge - nginx.conf
that has this extra bit in nginx.cfg
Update charset_types due to updated mime.types
charset_types text/xml text/plain text/vnd.wap.wml application/x-javascript application/rss+xml text/css application/javascript application/json;
now the only error im getting is
Oh. So the issue wasn't that it send the wrong mime type, but that it sent a 404 and therefore not JS but an HTML error message
yea sry i should've put that in as well
Do you have this line in your nginx config? Because the request for the JS file must be routed through Laravel.
Hm. Weird since it works with
livewire.js
but not with Filament JScould it be something from cloudflare
That's what I just thought. But still weird if it works with livewire.js
hmm i disabled the proxy in the dns settings on cloudflare and enabled it again
purge chrome cache its working now
no errors 🙂
Nice 👌🏼
thanks for your help