Recently migrated M2 from one server to another. Everything was fine until I redeployed static content, at which time the home page stopped loading styles.
I have tried everything under the sun:
rm -rf pub/static/*
rm -rf pub/static/frontend/*
rm -rf var/cache/*
rm -rf var/viewpreprocessed/*
rm -rf var/page_cache/*
rm -rf var/generated/*
rm -rf pub/static/adminhtml pub/static/frontend && php bin/magento cache:clean && php bin/magento cache:flush
php bin/magento setup:upgrade
php -d memory_limit=-1 bin/magento setup:di:compile
php -d memory_limit=-1 bin/magento -f setup:static-content:deploy en_AU
php -d memory_limit=-1 bin/magento deploy:mode:set production -s
chmod -R 777 pub/static/ pub/media/ var/ generated/
php bin/magento cache:flush
php -d memory_limit=-1 bin/magento indexer:reindex
php bin/magento cache:clean
I have set file and directory permissions, but nothing seems to work.
Note it is only the home page that is problematic.
The problem seems to stem from the following console errors:
The resource from “/pub/static/versionXYZ/_cache/merged/XYZ.min.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
The resource from “/pub/static/versionXYZ/_cache/merged/ABC.min.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
I’m unable to find what would correct this.