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

CSS reloaded: off by one by reload cycle #340

Open
danielsz opened this issue Sep 9, 2023 · 0 comments
Open

CSS reloaded: off by one by reload cycle #340

danielsz opened this issue Sep 9, 2023 · 0 comments

Comments

@danielsz
Copy link

danielsz commented Sep 9, 2023

Hi, I would like to start by saying how grateful I am for Figwheel, it is an essential piece of software in the Clojure ecosystem. Thank you!

I'm seeing an interesting anomaly with the CSS reload. It is off by one on my system. Suppose I have the following in my original CSS file:

body {
background: red;
}

I now make a change:

body {
background: blue;
}

The Chrome console prints:

[Figwheel CSS Reload] loaded ["/home/daniel/Clojure/fuji/resources/css/styles.css"] 

However, the page is still red. I go back to the CSS and I modify it again.

body {
background: green;
}

The Chrome console prints:

[Figwheel CSS Reload] loaded ["/home/daniel/Clojure/fuji/resources/css/styles.css"] 

The page is now blue.. Not green as in the saved file.
(It will be green on the next reload, with the saved file set to a new value. And so on.)

With each modification, Figwheel appears to do the correct things:
The Chrome inspector shows the CSS files with a query param (styles.css?zx=zd2c7uu46kxd), and in the terminal I can see the messages from the Directory Watcher:

21:07:45.121 [ForkJoinPool.commonPool-worker-2] DEBUG io.methvin.watcher.DirectoryWatcher - ENTRY_CREATE [resources/css/.#styles.css]
21:07:45.122 [ForkJoinPool.commonPool-worker-2] DEBUG io.methvin.watcher.DirectoryWatcher - Failed to hash created file [resources/css/.#styles.css]. It may have been deleted.
21:07:45.457 [ForkJoinPool.commonPool-worker-2] DEBUG io.methvin.watcher.DirectoryWatcher - ENTRY_MODIFY [resources/css/styles.css]
21:07:45.457 [ForkJoinPool.commonPool-worker-2] DEBUG io.methvin.watcher.DirectoryWatcher - -> MODIFY [resources/css/styles.css] (isDirectory: false)
21:07:45.471 [ForkJoinPool.commonPool-worker-2] DEBUG io.methvin.watcher.DirectoryWatcher - ENTRY_DELETE [resources/css/.#styles.css]

I'm on Linux:
Linux P14S 6.4.12-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 24 Aug 2023 00:38:14 +0000 x86_64 GNU/Linux

I'll be happy to provide more information if needed.

@danielsz danielsz changed the title CSS reloaded: off by one CSS reloaded: off by one by reload cycle Sep 9, 2023
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

1 participant