Varnish
Make changes to _extend.less
Run php bin/magento setup:static-content:deploy fi_FI en_US
LESS changes applied to CSS
LESS code in custom template is compiled to global LESS but not to CSS
The only workaround I've found is to set Magento into developer mode and then back to production mode.
Have you tried to clear the view_preprocessed folder with $ rm -rf /var/view_preprocessed? Alternatively you could clear CSS/JS Cache in Backend. Maybe this works for you.
Clearing var/view_preprocessed or CSS/JS Cache did not work.
Wondering if this is the same issue as MAGETWO-53094?
Did you make sure that the CSS files in pub/static didn't change? Or could it be that Varnish is simply serving cached versions of those files? I'm seeing a problem in my tests that Varnish does not purge static assets unless you restart it.
Did you have some news on this issue? We are runing the same problem, in production mode our LESS is not compiled.
Thank you.
@DnD-Merlin it might be a bit too heavy on the echos but you could use this bash script to deploy all themes and languages separatly.
#!/bin/bash
# Change these variables
LOCALES="en_US de_DE"
THEMES="Magento/blank Magento/luma YOUR_VENDOR/YOUR_THEME Magento/backend"
# Don't change anything after this line unless you know what you're doing!
echo "# Start check for bin/magento #"
echo ""
if ! test -e "bin/magento"
then
echo "bin/magento not found."
echo ""
exit 1
fi
echo "# Finish check for bin/magento #"
echo ""
echo "# Start deploying static content #"
echo ""
for locale in ${LOCALES}
do
echo "## Start with locale: ${locale} ##"
echo ""
for theme in ${THEMES}
do
echo "### Start with theme: ${theme} ###"
echo ""
php bin/magento setup:static-content:deploy ${locale} --theme ${theme}
echo "### Finish with theme: ${theme} ###"
echo ""
continue
done
echo "## Finish with locale: ${locale} ##"
echo ""
continue
done
echo "# Finish deploying static content #"
echo ""
echo "# Start clearing the caches #"
echo ""
echo "## Start cleaning the cache ##"
echo ""
php bin/magento cache:clean
echo "## Finish cleaning the cache ##"
echo ""
echo "## Start flushing the cache ##"
echo ""
php bin/magento cache:flush
echo "## Finish flushing the cache ##"
echo ""
echo "# Finish clearing the caches #"
echo ""
Hi @jwittorf,
we are actually runing commands in this order
bin/magento deploy:mode:set production -s bin/magento setup:static-content:deploy en_US fr_FR bin/magento setup:di:compile bin/magento setup:upgrade --keep-generated We already using bin/magento setup:static-content:deploy command, do you think we have to make it more precise ?
I don't like the approach running a separate command for every theme and language neither but I figured out that sometimes changes weren't made when just calling bin/magento setup:static-content:deploy or adding one or more languages to the call.
Don't ask me why but somehow some files weren't updated. With the script I can be sure that every language and every theme has been deployed. So my approach is more a workaround that an actual solution :(
Yes I agree. I will try your script if that solve my problem for now.
Thank you
@jwittorf Your script works well, tank you for that, but as you said it is only a workaround for now.
@rasmuswikman, thank you for your report.
We've created internal ticket(s) MAGETWO-83467 to track progress on the issue.
Really curious what causes this issue.
In every (!) installation of mine I'm able to regenerate LESS the following way in developer mode:
$ php bin/magento deploy:mode:set developer
$ php bin/magento setup:upgrade
as intial step. After that, all I have to do is:
$ rm -rf var/cache/* var/page_cache/* var/view_preprocessed/* pub/static/*
That said, I have disabled just a few caches to speed up developing to its most efficiency in my cases, but maybe here is the magic? If you disable
does it work for you with this pattern?
However - you still have Varnish in front. So maybe you just need to flush the cache of varnish or disable it for sorting out the problem. If the right CSS is shown in frontend with Varnish disabled, the problem is varnish - you should try the magento CLI functions of flushing caches, it should clear the cache (by semantic I'd guess) and also clear varnish.
Would love to get some feedback from you as I believe this bug is maybe due to some weird configurations. But just my 2 cents.
Same problem on 2.2.2, the script @jwittorf provided doesn't work for me :( . The only option I have is still to switch from developer mode and then back to production.
@Any update on this issue? I am facing it on 2.2.2?
Please @magento-engcom-team you should pay attention to these issues.
Had the same problem today on a 2.1.11 installation and the only solution that worked was @grasdaggel 's developer mode and upgrade commands.
@obatkova thank you for joining. Please accept team invitation here and self-assign the issue.
I am working on this at #dmcdindia
@chirag-wagento thank you for joining. Please accept team invitation here and self-assign the issue.
I have created _extend.less file in luma theme and add some css code for home page . I can see my changes on frontend
After add css please follow below step:
1) php bin/magento setup:upgrade
2) php bin/magento setup:static-content:deploy fi_FI en_US
php bin/magento setup:upgrade This is required before run static-content:deploy command
Hello Team,
I am also facing same issue when i follow the below scenario
Magento 2 version is: 2.2.3 CE
Mode:- Production
Css/Js :- if the files are in merged from developer mode
File/path from theme :- app/design/frontend/Custom/demo/web/css/custom.less
Server:- AmazonCloud (magemojo)
Result:- These custom.less files changes are not effecting/updating in the respected custom.css in the pub folder.
Again if i switched to developer i am able to see the changes.
Can you provide your thoughts on this.
Thanks
I can reproduce similar symptoms on our installation. However, for the en_US locale it works fine. For other locales LESS compilation fails.
My steps to reproduce
# Ensure we're working with a clean slate
rm -rfv pub/static/frontend/Company/default
# Compile static content for en_US locale
bin/magento setup:static-content:deploy --exclude-area adminhtml --theme Company/default --language en_US
grep -rn 'some_class' pub/static/frontend/Company/default/en_US
Expected and actual result:
Now let's try that for a different locale!
# Compile static content for en_AU locale
bin/magento setup:static-content:deploy --exclude-area adminhtml --theme Company/default --language en_AU
grep -rn 'some_class' pub/static/frontend/Company/default/en_AU
Expected result:
Actual result:
edit:
But wait a minute.. if I run bin/magento setup:static-content:deploy en_US en_AU then it does seem to work correctly. Looks like a bug in the CLI app. Running on 2.1.4, so fairly outdated. Not sure if related to OP.
Hi @OleksiiStepanov. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if your want to validate it one more time, please, go though the following instruction:
Component: XXXXX label(s) to the ticket, indicating the components it may be related to.[x] 2. Verify that the issue is reproducible on 2.3-develop branchDetails
- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!
[ ] 3. Verify that the issue is reproducible on 2.2-develop branch. Details
- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x
[ ] 4. If the issue is not relevant or is not reproducible any more, feel free to close it.
Hi @Rus0. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:
Component: XXXXX label(s) to the ticket, indicating the components it may be related to.[ ] 2. Verify that the issue is reproducible on 2.3-develop branchDetails
- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!
[ ] 3. If the issue is not relevant or is not reproducible any more, feel free to close it.
Working on #cd19LATAM
The issue should be re-checked on the latest 2.4-develop branch.
If its still actual on 2.4-develop it should be confirmed with the label Reproduced on: 2.4.x Description and versions should be updated
If not the issue should be closed