Skip to content
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

Frontend Cache-Clean [F] does not seem to clear static content #105

Open
kolaente opened this issue May 20, 2022 · 6 comments
Open

Frontend Cache-Clean [F] does not seem to clear static content #105

kolaente opened this issue May 20, 2022 · 6 comments
Assignees

Comments

@kolaente
Copy link

When pressing F, the files in pub/static/frontend are still present.

@Vinai
Copy link
Contributor

Vinai commented May 20, 2022

Thanks for opening the issue @kolaente - I must have broken it at one point in time!

@Vinai Vinai self-assigned this May 20, 2022
@Vinai
Copy link
Contributor

Vinai commented May 20, 2022

I am unable to reproduce the issue.
When I press F the files in pub/static/frontend are gone, only the directories remain.


My steps to reproduce on my current dev instance:

  1. Reload the homepage after clearing static view files.
  2. Then, list all files and symlinks (because I am running in deploy mode developer).
$ find pub/static/frontend/ -type f -or -type l
pub/static/frontend/Hyva/default/de_CH/Magewirephp_Magewire/js/livewire.js
pub/static/frontend/Hyva/default/de_CH/Magewirephp_Magewire/js/livewire.js.map
pub/static/frontend/Hyva/default/de_CH/css/styles.css
pub/static/frontend/Hyva/default/de_CH/Hyva_Theme/js/alpine.min.js
pub/static/frontend/Hyva/default/de_CH/Hyva_Theme/js/alpine.min.js.map
pub/static/frontend/Hyva/default/de_CH/Magezon_Core/css/owlcarousel/owl.carousel.min.css
pub/static/frontend/Hyva/default/de_CH/Magezon_Core/css/styles.css
pub/static/frontend/Hyva/default/de_CH/Magezon_Core/css/mgz_bootstrap.css
pub/static/frontend/Hyva/default/de_CH/Magezon_Core/css/fontawesome5.css
pub/static/frontend/Hyva/default/de_CH/Magento_Theme/favicon.ico
pub/static/frontend/Hyva/default/de_CH/images/hero-2x.jpg
pub/static/frontend/Hyva/default/de_CH/images/hyva-logo.svg
pub/static/frontend/Hyva/default/de_CH/images/logo.svg
  1. Press F in the cache-watcher
  2. Finally, list all files and symlinks, again
$ find pub/static/frontend/ -type f -or -type

Result: no files are left.

@Vinai
Copy link
Contributor

Vinai commented May 20, 2022

Please let me know if I am missing a step when reproducing the issue.

@sprankhub
Copy link

I just (partially) bumped into this issue. In general, [F] clears static content files for me. However, it seems to not clear any broken symlinks. So if there is a broken symlink under pub/static, this broken symlink will not be removed, which may lead to issues.

Use case:

  1. Override a file in your theme.
  2. Open the page, so that the symlink for this file is created.
  3. Remove the file from your theme, because you do not want to override it any more.
  4. Press [F].

Expected: The broken symlink of the old overridden file is removed.
Actual: The broken symlink is not removed, so that Magento is missing a file in the frontend.

@Vinai
Copy link
Contributor

Vinai commented Nov 8, 2022

That's interesting. I wonder why the broken symlinks are not removed.
If I recall correctly, this function should remove them, too...

@sprankhub
Copy link

I just bumped into this again. I have no idea about ClojureScript, but I figured the files are unlinked via the rm function. Could it be that the following exists? check returns false for broken symlinks, so that they are not unlinked?

(when (exists? file)

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

No branches or pull requests

3 participants