After having done setup: upgrade, setup: static-content: deploy and setup: say: compile my web does not load the resources css or js.
First I placed my website in developer mode, I noticed that there were problems with a module and decided to update it, after running the aforementioned commands I began to have problems in the consistency of the web. Currently it loads some static files but all css and js indicate 404 error or MIME type ('text / html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
I have tried to change the web to production mode and deploy static content multiple times, however until now I have not been able to load all the content of my website.
I use Magento 2.3.1 in Centos 7
Any idea what might be causing this problem?
Hello @luis_suarez2
These are the ways to resolve the issues:
Upgrade and deploy again.
Flush cache.
It will resolve the issues.
Hope it helps.
Please check that .htaccess file is there in your pub/static directory or it is removed ?
Also please run below commands in sequence :
php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy php bin/magento cache:clean php bin/magento cache:flush
Also refer this link for more solutions like you need to set proper permissions to pub directory - https://magento.stackexchange.com/questions/212514/refused-to-apply-style-because-its-mime-type-text...
Also please follow the steps mentioned by @Meetanshi
Hope it helps !
Hi, thank you very much for your answers. So far I have tried to replace the .htaccess files in the pub and pub / static folders, however I continue to receive the same error messages in both the css and the js. I have followed the steps proposed by Meetanshi, but the problem persists
As mentioned above i would suggest you to run those command in sequence like after compile run static-content:deploy -f command.
Also please give files and folders permissions again - here by i am sharing reference link for the same - https://magento.stackexchange.com/questions/91870/magento-2-folder-file-permissions
Hope it helps !
On the other hand, I also tried to look for the specific url of my js or css files and the following happens, those specific paths exist inside my server and lead to the correct files, however when I enter the url of the files in my browser I get Error 404
Hello, @luis_suarez2 again!
This link might be helpful too!
Thanks.