1

Unable to run bin/magento setup:static-content:deploy -f without compilation error after upgrading Magento to 2.3.3 from 2.2.8.

Other messages included:

Deploy using quick strategy frontend/Magento/blank/en_US 2449/2533 ===========================> 96% 1 sec Compilation from source: /vendor/magento/theme-frontend-blank/web/css/styles-l.less variable @theme__color__primary-alt is undefined in file /var/view_preprocessed/pub/static/frontend/Magento/blank/en_US/Magento_Braintree/css/source/_module.less in _module.less on line 13, column 26

RuntimeError: No matching definition was found for `.lib-font-face in _typography.less

1

Because my environment was running in Vagrant I had to re-sync back certain folder to the host, but did not include the /lib folder. This error has nothing to do with your theme less.

After copying over the /lib folder from 2.3.3 source to my project and running the following commands:

rm -rf lib/internal/Magento    
rm -rf var/cache var/page_cache var/view_preprocessed pub/static/*

Then running

php bin/magento setup:static-content:deploy -f

Completed succesfully.

Another way to debug less errors or see the exact issue in more detail is by running.

bin/magento dev:source-theme:deploy --theme=Magento/blank --locale=en_US

node_modules/.bin/lessc -l var/view_preprocessed/pub/static/frontend/Magento/blank/en_US/css/styles-m.less

This will only show the blank theme errors.

|improve this answer|||||
  • For me the lib folder wasn't transferred over when upgrading Magento - after I've done this, setup:static-content:deploy worked fine, and the website started working properly again. – Smithee Mar 26 at 13:03

Your Answer

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

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