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

With --serve, changing a partial triggers a rebuild but doesn't use the updated partial #7

Open
RickMohr opened this issue Oct 7, 2023 · 6 comments
Labels
bug Something isn't working 📦 handlebars

Comments

@RickMohr
Copy link

RickMohr commented Oct 7, 2023

Operating system

Windows 10

Eleventy

2.0.1

Describe the bug

If you run 11ty in "serve" mode and change a partial file, a rebuild is triggered but the changed partial is not used.

Note that several comments at the bottom of 11ty/eleventy#596 describe similar issues (both MacOS and Windows).

Reproduction steps

This dead-simple project demonstrates the issue. From its README:

  1. npm install
  2. npx eleventy --serve
  3. Browse to localhost:8080 -- you should see "Hello Bug!"
  4. Change src/_includes/world.hbs to contain "World!" instead of "Bug!" -- a rebuild is triggered and the page is reloaded, but it still says "Hello Bug!"
  5. Restart npx eleventy --serve and reload the page -- now you correctly see "Hello World!"

Expected behavior

After changing "Bug!" to "World!" the web page should show "Hello World!" without needing to restart the server.

Reproduction URL

https://github.com/RickMohr/eleventyBug

Screenshots

No response

@RickMohr RickMohr changed the title With --serve, changing a template triggers a rebuild but doesn't use the updated template With --serve, changing a template triggers a rebuild but doesn't use the updated partial Oct 8, 2023
@RickMohr RickMohr changed the title With --serve, changing a template triggers a rebuild but doesn't use the updated partial With --serve, changing a partial triggers a rebuild but doesn't use the updated partial Oct 8, 2023
@RickMohr
Copy link
Author

This is a problem when using handlebars (as shown in the example), but not when using nunjucks.

@johannesrave
Copy link

a similar or the same thing happens when using WebC components. changing a component triggers a rebuild, but the files (and accordingly, the browser preview) aren't updated.
looking at the extended logs by running DEBUG=ELEVENTY* npx eleventy --serve shows me, that unchanged files are being rendered again.
this was reported in the discord-help section as well - seems like some kind of cache invalidation bug to me.

@johannesrave
Copy link

ah, looks like a duplicate of 11ty/eleventy#2924

@johannesrave
Copy link

for me this (mostly) works in the current alpha installed directly from github, in my case using pnpm:
pnpm add -D github:11ty/eleventy#v2.0.2-alpha.2

@zachleat zachleat transferred this issue from 11ty/eleventy Jul 10, 2024
@zachleat
Copy link
Member

This is likely fixed by the new handlebars compat plugin for Eleventy 3.0+

@zachleat zachleat added the bug Something isn't working label Jul 10, 2024
@peekxc
Copy link

peekxc commented Aug 19, 2024

(this has also been a longstanding issue with the pugjs plugin, so seems systematic)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 📦 handlebars
Projects
None yet
Development

No branches or pull requests

4 participants