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

Handlebars partials inside templates do not update #2799

Closed
groenroos opened this issue Feb 9, 2023 · 3 comments
Closed

Handlebars partials inside templates do not update #2799

groenroos opened this issue Feb 9, 2023 · 3 comments

Comments

@groenroos
Copy link

groenroos commented Feb 9, 2023

Operating system

macOS Ventura 13.0

Eleventy

2.0.0

Describe the bug

With --serve, changes made to Handlebars partials (located inside the includes directory) that are used in templates (layouts) will seem to trigger an appropriate build, and the page will refresh, but the changes to the partial are ultimately not reflected (i.e. the old/cached version of the partial is still used for the build).

Changes to templates, or changes to partials used directly on pages, will build as expected. Turning off compileOptions.cache does not seem to have any effect.

Reproduction steps

  1. Have 11ty project using Handlebars
  2. Use a partial {{ some-partial }} (includes) inside a template some-template.hbs (layouts)
  3. Use the template some-template on a page some-page.hbs (input) via frontmatter
  4. Run npx @11ty/eleventy --serve and view the page /some-page in a browser
  5. Make a change to the some-partial partial

Expected behavior

The page should be re-built with the new contents of the partial.

Reproduction URL

No response

Screenshots

No response

@SteveUlin
Copy link

On my computer, setting they 11ty version to "2.0.0-canary.20" resolves this issue.

I believe this regression was introduced with some of the December work on the template engine. Those changes were released with 2.0.0-canary.21. But I haven't looked at the code too closely, that's just a guess.

https://github.com/11ty/eleventy/commits/2decde923e5a501cf803e4adaaff5785d1b52671/src/Engines/TemplateEngine.js

@zachleat
Copy link
Member

Update: I am able to reproduce this!

@zachleat
Copy link
Member

This will ship with 2.0.1

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

No branches or pull requests

3 participants