Skip to content

Static deploy doesn't update files #38176

@webloft

Description

@webloft

Summary

There are files which gets never updated by command set:sta:dep - and it's very annoying if you need to this in production mode as it costs real- and downtime for clients. The only work around is to entire removing pub/static/frontend and/or var/view_preprocessed.

I don't know it this is reported yet, I really wonder if not. We are still expierencing this behaviour in 2.4.6

Examples

It affects multiple files if changes are made in theme files/overrides:

  • If there is a compiled css file as in /app/design/<theme>/../*.css
  • For template files for what content need to be preprocessed
  • For translation files used for Javascript

Running set:sta:dep -f will update nothing here for pub/static/frontend and switching strategy has also no effect on this.

Additional Information

Your basic vanilla theme may does not trigger the bugs. Therefore it's needed to test it on a real world example. We work with different clients that uses different themes and expierence the same problems. One client even uses a custom theme that is only styles and templates, no custom code or interceptors that could cause troubles.

As written before - the most common one is if a CSS file from a theme is modified by the client. This can be a normal file included via Magento_Theme/layout/default_head_blocks.xml like this:

<css src="Magento_Theme::css/custom.css"/>

and placed in /app/design/frontend/theme/child/Magento_Theme/web/css/custom.css

We verified that the file was modified on the server.

We run the command set:sta:dep -f in production mode. It displays the process and everything seems fine.

However, if we inspect the file in pub/static/frontend/theme/child/en_US/Magento_Theme/css the file is there, minified as custom.min.css but contents are not updated and the file is not touched at all.

Only if we remove the complete folder or at least the affected area/theme, the changes will be applied.

Observation:

It works if the file is not there. But for some reasons the file will be ignored if it's already there.

Also applies to dynamic JS translation file, for example: en_US/js-translation.json.

We updated a theme translation file. It was ignored by deploy command. The changes will be applied if we remove en_US/js-translation.json manually and then run static deploy command again.

Proposed solution

No response

Release note

No response

Triage and priority

  • 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”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: FrameworkComponent: DeployIssue: needs updateAdditional information is require, waiting for responsePriority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Progress: PR CreatedIndicates that Pull Request has been created to fix issueReported on 2.4.6Indicates original Magento version for the Issue report.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions