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

Making changes to the CSS does not provoke a reboot of styles #128

Open
cawa-93 opened this issue May 4, 2022 · 6 comments
Open

Making changes to the CSS does not provoke a reboot of styles #128

cawa-93 opened this issue May 4, 2022 · 6 comments
Labels
open-question Further information is requested from the original poster.

Comments

@cawa-93
Copy link

cawa-93 commented May 4, 2022

I run 11ty by npm run serve. Every time I make any changes to the CSS, I can't see them. 11ty does not hot-reload changes, does not restart inself, does not passthrough Copy files from css to _site/css. I have to manually restart the developer server after each change to css/* file

@zachleat
Copy link
Member

Could be a few things:

Did you make changes to the addPassthroughCopy entries in your config file? Did you rename your config file to a non-default filename? Is the correct config file being read?

@zachleat zachleat added the open-question Further information is requested from the original poster. label Jun 29, 2022
@grahamharper
Copy link

grahamharper commented Sep 12, 2023

I'm having the same issue and can reproduce on a fresh clone of the repo.

  1. Clone this repo
  2. npm install
  3. npx @11ty/eleventy --serve
  4. Modify index.css e.g. body { background: hotpink; }` and save the file

Console outputs [11ty] File changed: public/css/index.css and rebuilds all site pages but the page doesn't automatically reload with new styles. You must refresh the page to see the style changes.

Same on node 18 and 20.

@patrickgrey
Copy link

patrickgrey commented Sep 27, 2023

Same issue for me with minimal changes to starter. I'm on windows, Node 18.

I can see in dev tools that the cache busting link query string does change on save e.g. (?_11ty=169582224106) so the hotload trigger is working.

However, if I open the link in a new tab, the old version of the CSS file is being served. If I look in the _site folder, the CSS has been updated. Would this point towards server caching, part of the incremental feature?

I added --incremental but this had no effect. I have noticed that my HTML source code has a weird " -" character appended just after the body tag and before the CSS and reload-client script links. No idea if that is relevant 😬

@darby3
Copy link

darby3 commented Nov 28, 2023

For what it's worth—and I'm maybe out of my depth—I'm seeing that (after I commented out the inline style output in base.njk in favor of the to the external bundle file) the bundler in the output html remains pointing to the originally created version of the bundle after I change the css file in public/css.

So like I make changes to the public/css file, I see _site/css/index.css change, but there's nothing happening in the _site/bundle folder.

Console says "11ty][21:22:01.071 UTC] CSS updated without page reload." according to reload-client.js, so it's noticing that index.css is updating, but.

@cbracco
Copy link

cbracco commented Dec 17, 2023

Can also replicate this issue the same way as @grahamharper. I’m on macOS 14.1.1, using Node 18.

@cbracco
Copy link

cbracco commented Dec 17, 2023

When I switched to just referencing the CSS file directly instead of using the bundle plugin, live reload works:

<link rel="stylesheet" href="/css/index.css">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-question Further information is requested from the original poster.
Projects
None yet
Development

No branches or pull requests

6 participants