0

I have a own template in app/design/frontend/tm/XXX-theme. I built it like described in the dev docs. Parent theme is luma. Magento run in developer Mode. After i use setup:static-content:deploy de_DE en_GB. SSH shows:

Compilation from source:
frontend/tm/XXX-theme/de_DE/css/styles-m.less
Warning: Invalid argument supplied for foreach() in /www/htdocs/XXX/XXX/XXX/vendor/oyejorge/less.php/lib/Less/Tree/Value.php on line 26

In Browser Template CSS is not loading:

The resource from “https://www.example.com/pub/static/frontend/tm/XXX-theme/de_DE/css/styles-m.css” was blocked due to MIME type (“text/plain”) mismatch (X-Content-Type-Options: nosniff)

Have anyone a Idea? I read since yet many articel for this Problem and tried. But I have no clue.

2 Answers 2

1

This is normally the result of a compilation error in the css.

Its failing and something is not generating. Have you tried running static content deploy with show errors. Failing that dump php output to file. This can be a pain to debug.

php -d display_errors=1 bin/magento setup:static-content:deploy

php -d bin/magento setup:static-content:deploy > output.log

Update

Your memory limit is low. Try to see if you can put this up to at least 512MB.

Try this instead

php -d display_errors=1 -d memory_limit=-1 bin/magento setup:static-content:deploy

3
  • Thanks for response. After I use this comand i got this: .PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2097160 bytes) in /www/htdocs/XXX/XXX/XXX/vendor/oyejorge/less.php/lib/Less/Output.php on line 27
    – Marcel
    Jun 5, 2019 at 13:28
  • I've edited my answer. Check again. Jun 5, 2019 at 16:08
  • with this the process (SSH) works till the end without break. This is one progress. But I get 8 Errors for each .less: Compilation from source: /www/htdocs/w00aa751/TMneu/magento2.2.1/vendor/magento/theme-frontend-blank/web/css/styles-m.less This is one of it: Compilation from source: frontend/tm/XXX-theme/en_GB/css/styles-m.less Warning: Invalid argument supplied for foreach() in /www/htdocs/xxx/xxx/xxx/vendor/oyejorge/less.php/lib/Less/Tree/Value.php on line 26
    – Marcel
    Jun 6, 2019 at 7:15
0

I tried many things. After I delete the CSS File complete from my custom theme it works after setup:static-content:deploy. I think there was a problem with any less or css in my custom theme. So it throw an error within the compiling progress. Now the fallback works and the data come from the parent theme.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.