2

We have an ongoing issue with our styles.less file that prevents the css being generated for the Magento 2.1.8 back end.

Whe i run the command

bin/magento setup:static-content:deploy

It throws this error

Compilation from source: /microcloud/domains/operm2/domains/dev.website.co.uk/http/vendor/magento/theme-adminhtml-backend/web/css/styles.less

Compilation from source:
adminhtml/Magento/backend/en_GB/css/styles.less
Unable to get content for 'adminhtml/Magento/backend/en_GB/Magento_Checkout/css/source/_module.less'

In the styles.less file it is failing to import any of the other _module.less.

We currently have around 20 imports in this file:

@import '../Magento_Checkout/css/source/_module.less';
@import '../Ess_M2ePro/css/source/_module.less';
@import '../Magento_AdminNotification/css/source/_module.less';
@import '../Magento_AdvancedCheckout/css/source/_module.less';
@import '../Magento_Backend/css/source/_module.less';
@import '../Magento_Banner/css/source/_module.less';
@import '../Magento_Braintree/css/source/_module.less';

When i comment out the first import line:

@import '../Magento_Checkout/css/source/_module.less';

The error will then change to:

adminhtml/Magento/backend/en_GB/Ess_M2ePro/css/source/_module.less

has anyone encountered this error before? The file paths for the imports all contain the expected files, could this be an issue with permissions?

Thanks.

  • Hi, I am also having same issue. It started happening all of a sudden. We tried setting permissions but didn't help. Every time we used to delete app directory and pull it from our repo to make static content deploy work. Not sure what is the problem, we are still investigating the issue. Let us know if you get any solution. – Kalyan Chakravarthi V Mar 19 '18 at 10:51
  • Hi Kalyan. As a work around, we are copying the adminhtml styles.css from one of our backups directly into the pub/static folder. This might be a quicker temporary work around for you. I have found a number of people who have had this issue and then they say have fixed it without giving a solution. If I find a solution I will make sure to post it back here so any future people who have the problem can easily fix it. – dev Mar 19 '18 at 10:58
  • out of curiosity, what are the contents of your styles.less file in the vendor directory? – dev Mar 19 '18 at 11:01
  • We didn't even touch any less file, we added a custom CSS file for frontend changes. – Kalyan Chakravarthi V Mar 19 '18 at 11:03
  • did you over ride the existing theme? – dev Mar 19 '18 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.