Skip to content

Style is not getting compiled #32149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 5 tasks
Eddcapone opened this issue Feb 12, 2021 · 10 comments
Closed
1 of 5 tasks

Style is not getting compiled #32149

Eddcapone opened this issue Feb 12, 2021 · 10 comments

Comments

@Eddcapone
Copy link

Eddcapone commented Feb 12, 2021

Preconditions (*)

2.4.2
Production Mode

Steps to reproduce (*)

I try to compile my code from my build system.

I don't know how we can reproduce it, today it worked the whole day but suddenly it fails.

php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy en_US de_DE

git add pub/static/
git add pub/media/
git add generated/
git commit -m "Update Static Files"
git push

cd ~/staging    // Same branch checked out
php bin/magento maintenance:enable
git pull
php bin/magento cache:clean
php bin/magento maintenance:disable

Expected result (*)

If I load the frontend then the changes I made in dev should be visible in staging after deployment.

Actual result (*)

Changes are not there.


Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Feb 12, 2021

Hi @Eddcapone. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@Eddcapone
Copy link
Author

Eddcapone commented Feb 12, 2021

There is one workaround. You can trigger the build if you change from deploy mode production to developer and then back to production. This will trigger the compilation.

There is a major bug somewhere in setup:static-content:deploy and I have to change my deploy script to this until it gets fixed:

php bin/magento deploy:mode:set developer
php bin/magento deploy:mode:set production

git add pub/static/
git add pub/media/
git add generated/
git commit -m "Update Static Files"
git push

cd ~/staging    // Same branch checked out
php bin/magento maintenance:enable
git pull
php bin/magento cache:clean
php bin/magento maintenance:disable

@mrtuvn
Copy link
Contributor

mrtuvn commented Feb 13, 2021

one note production mode must run static content deploy but developer mode not require it
Most important command is run setup:upgrade for get sync.
In developer mode you don't have run all commands. For daily work i just only use setup:upgrade (my Frontend task for update styles). For uncommon task may need to change some tools in workflow
In production you have to run all commands
@ihor-sviziev @hostep may know better in this in process deploy content static

@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented Feb 13, 2021

@Eddcapone
Actually before executing php bin/magento setup:static-content:deploy command you should delete var/view_preprocessed, pub/static/* (deployed version file, frontend and adminhtml folders).
usually php bin/magento setup:upgrade Command does it. This command executed during switching to production mode afaik

@mrtuvn
Copy link
Contributor

mrtuvn commented Feb 13, 2021

@Eddcapone
Copy link
Author

Eddcapone commented Feb 15, 2021

I was following this guide from the documentation about pipeline deployment, and it does not mention that we have to execute setup:upgrade. I will try it asap.

"one note production mode must run static content deploy but developer mode not require it"
I know. My build system is in production mode and my release project too.

@mrtuvn
Copy link
Contributor

mrtuvn commented Feb 15, 2021

Before compile code by command setup:di:compile you should run setup upgrade first. Use this for both Dev or production
If you change etc/env.php you need run app:config:import

@Eddcapone
Copy link
Author

I changed my deploy script to this:

php bin/magento setup:upgrade
php bin/magneto setup:di:compile
php bin/magento setup:static-content:deploy de_DE en_US

git add pub/static/
git add pub/media/
git add generated/
git commit -m "Update Static Files"
git push

cd ~/staging    // Same branch checked out
php bin/magento maintenance:enable
git pull
php bin/magento cache:clean
php bin/magento maintenance:disable

The style changes were still not applied.

@Eddcapone
Copy link
Author

I also tried this

php bin/magento setup:upgrade
php bin/magneto setup:di:compile
php bin/magento setup:static-content:deploy

The style changes were still not applied.

@Eddcapone
Copy link
Author

It was my fault, I forgot to commit a file, it works with:

php bin/magento setup:upgrade
php bin/magneto setup:di:compile
php bin/magento setup:static-content:deploy

I will create an issue in the documentation and explain that there is a step missing.

Thank you very much @mrtuvn and @ihor-sviziev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants