Server: i7-4770, 32 GB RAM
PHP: 7.0.9
MySQL: 5.7.19
Magento CE 2.2 fresh install. Worked normally.
Hard to tell, nothing special i did. I found changed setup:static-content:deploy command and starting testing it for my configuration with "--force" flag. Several times manual i cleaned static/cache/generated files. After that, this happend.
Automatic static content deployment is stopped working.
All js and css files on adminhtml/frontent area returns 404.
Site totally defaced, only manual deployment working.
No errors on log files.
All directory/files permission seems to be ok.
Normal functionality of static content deployment.
Hi @am2008, thank you for reporting this issue.
The Label G1 Failed
means that the team asks everybody to use the issue template (see Gate 1 - Automatic Verification and Issue reporting guidelines). I add the label needs update
to reflect this.
Please update the issue if you or somebody else finds a way to reproduce this problem. Also, add information regarding your setup (webserver, PHP version, is this an upgrade from version 2.x or a fresh install, ...) and check your log files for helpful content.
Thanks!
@mzeis thanks for explanation, sorry for violating the rules.
@am2008
Result you described may happen when Magento is is production mode and static content is removed. Please check.
@magento-engcom-team
/generated/code
/generated/metadata
/pub/static/adminhtml
/pub/static/frontend
/var/view_preprocessed
404 http://***/pub/static/adminhtml/Magento/backend/ru_RU/extjs/resources/css/ext-all.css
404 http://***/pub/static/adminhtml/Magento/backend/ru_RU/mage/requirejs/mixins.js
404 http://***/pub/static/adminhtml/Magento/backend/ru_RU/jquery/jstree/themes/default/style.css
404 http://***/pub/static/adminhtml/Magento/backend/ru_RU/css/styles.css
404 http://***/pub/static/adminhtml/Magento/backend/ru_RU/requirejs/require.js
404 http://***/pub/static/adminhtml/Magento/backend/ru_RU/extjs/resources/css/ytheme-magento.css
404 http://***/pub/static/adminhtml/Magento/backend/ru_RU/mage/requirejs/mixins.js
404 http://***/pub/static/adminhtml/Magento/backend/ru_RU/images/magento-logo.svg
Uncaught TypeError: require is not a function
at requirejs-config.js:71
at requirejs-config.js:78
at requirejs-config.js:428
Uncaught TypeError: require.config is not a function
at (index):32
Uncaught TypeError: require is not a function
at (index):81
setup:static-content:deploy --force --area adminhtml --theme Magento/backend;
setup:static-content:deploy --force --area adminhtml --theme Magento/backend ru_RU;
setup:static-content:deploy --force --area frontend --theme ***/*** ru_RU
@am2008 Please check your directory permissions according to devdocs
Permissions is ok, it first thing i checked then this happend.
I did again clean install of Magento 2.2, and all works fine now.
Heaven forbid to run "manual static deployment content" in 2.2 again.
And again...
1. Same problems on local WAMP.
I'm successufully installed Magento 2.2 CE on local env(OpenServer) there no file permission related problems and got same result - all static content gives 404. In pub/static/. folder, again - only one requirejs-config.js
Note - it is clean install and first request to magento admin area. Before the 2.2 release, there was no problem with static content.
This is some kind of nightmare. Please help!
@am2008 don't use WAMP, don't use XAMPP, don't use OpenServer - Windows is not supported and obviously there will be bugs.
@orlangur ok, but LAMP have same issue as WAMP(by the way, magento works well on Windows environment, as example - Bitnami Magento Stack).
I write again: sometimes magento refuses to generate static content, only requirejs-config.js file appears. I have two magento 2.2 installation in one container(prod+dev). Dev worked two days and was broken(see first post), after reassambling he's ok. Prod is clone of Dev and now having 50% of this issue(see p.2 prev post).
@am2008 See also https://github.com/magento/magento2/issues/13298
The same problem.
After update 2.2.1 to 2.2.2
PHP 7.0, MySQL 5.7, Apache 2.4
sometimes magento refuses to generate static content, only
requirejs-config.js
file appears
@am2008 @statuscue this cannot be fixed without some investigation on your side. Please try to find cause in core code or exact steps to reproduce issue on a clean installation.
Same problem. Xampp on Windows 10.
All requirements are installed.
Flew through the setup perfect.
Static assets missing.
One of the many errors in web developer console:
Refused to apply style from 'http://magento.theupstyler.com/pub/static/version1519808854/adminhtml/Magento/backend/en_GB/extjs/resources/css/ext-all.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
That URL returns a custom 404 with only message "404 error: Page not found."
I dug through the code but got stuck at bootstrap.php:256
$response = $application->launch();
I have no idea which launch function is actually going to run from that URL.
I could dig further but seems like the issue is somewhere else....
e.g. Magento doesn't like to run on Windows 10 :-/
It's interesting how the app is bootstratpping an entire application just to load one css file.
Solution for now will be to run a Magento 2 via Docker
Alternative will be to install Linux and hope it works there.
just fixed the same issue by recovering pub/static/.htaccess file
which i previously deleted
We are also facing the same issue. How come this ticket was closed ?
In my case, my dev site set mode is production and I used command: bin/magento setup:static-content:deploy it just deploy static content for en_US and not deploy for en_AU so all static of AU site is missed. I have to deploy using command: bin/magento s:s:d en_AU then all works as normal
When you switch from developer mode to production mode it will deploy static content for all languages. but when you use command bin/magento setup:static-content:deploy it just deploy static for en_US
I wrote post describe more detail here:
https://mrvts.wordpress.com/2018/08/29/magento-2-break-layout-with-message-refused-to-apply-style-because-its-mime-type-text-html-is-not-a-supported-stylesheet-mime-type/
One more thing can cause this issue is webroot mapping. I see that in css url not include pub path. In my case I use apache 2 on Ubuntu I got this issue when map webroot like this:
VirtualDocumentRoot /var/www/html/my_project/
then I change to this:
VirtualDocumentRoot /var/www/html/my_project/pub/
and I resolved this isssue.
Having same issue on a shared hosting, where all write permissions are correct, Magento2 installation is successful, but the only generated static file is requirejs-config.js and don't have shell access. Why is this issue closed? I also opened a similar issue: #21201
Hi there, if some people are still in trouble with that issue, simply remove or switch _dev/static/sign_ setting, from _core_config_data_ table, to 0.
It did the trick on my side.
Check https://github.com/magento/magento2/issues/7869 for more details.
Most helpful comment
just fixed the same issue by recovering pub/static/.htaccess file
which i previously deleted