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

Layout file changes not reflected until restart #2717

Closed
rothsandro opened this issue Dec 27, 2022 · 6 comments
Closed

Layout file changes not reflected until restart #2717

rothsandro opened this issue Dec 27, 2022 · 6 comments
Assignees
Labels
bug release: canary A release on the canary channel

Comments

@rothsandro
Copy link

rothsandro commented Dec 27, 2022

Operating system

macOS Monterey 12.0

Eleventy

2.0.0-canary.23

Describe the bug

When making a change in a layout file (.njk), the changes are not reflected until I restart Eleventy. Eleventy detects that the file has changed (File changed: ... in the terminal) and updates all pages, but it looks like it uses a cached version of the layout file.

The last version with which it worked was canary.20. Canary 21 added incremental builds for layout file changes (see #108 (comment)), so I guess that broke the non-incremental setup...

Reproduction steps

  1. Start Eleventy with eleventy --serve
  2. Make a change in the layout file base.njk that is used in index.md => Changes not visible in the browser
  3. Restart Eleventy => now you will see the changes

Expected behavior

Eleventy should write all pages with the updated layout file instead of the cached one.

Reproduction URL

https://github.com/rothsandro/repro.eleventy-layouts

Screenshots

No response

@zachleat zachleat added bug release: canary A release on the canary channel and removed needs-triage labels Jan 5, 2023
@zachleat
Copy link
Member

zachleat commented Jan 5, 2023

This was fixed in Eleventy 2.0.0-canary.24, thank you!

aa9fdab

(Would love a confirmation from you though!)

@zachleat zachleat added this to the Eleventy 2.0.0 milestone Jan 5, 2023
@zachleat
Copy link
Member

zachleat commented Jan 5, 2023

This is an automated message to let you know that a helpful response was posted to your issue and for the health of the repository issue tracker the issue will be closed. This is to help alleviate issues hanging open waiting for a response from the original poster.

If the response works to solve your problem—great! But if you’re still having problems, do not let the issue’s closing deter you if you have additional questions! Post another comment and we will reopen the issue. Thanks!

@zachleat zachleat closed this as completed Jan 5, 2023
@rothsandro
Copy link
Author

Thanks, I tested it with the new version.

It works fine with the default input directory .. When I create a subfolder src and use it as input directory (see commit rothsandro/repro.eleventy-layouts@db943ae), the first change after starting Eleventy is applied but making another change in the same file doesn't work, Eleventy rebuilds the site but uses the cached version with only the first change.

@zachleat zachleat reopened this Jan 6, 2023
@zachleat
Copy link
Member

zachleat commented Jan 6, 2023

Ah, hmm. Confirmed this, looking now.

@zachleat
Copy link
Member

zachleat commented Jan 6, 2023

Missed one cache key in there, sorry about that! This will be packaged up with 2.0.0-canary.25

@rothsandro
Copy link
Author

Now it works correctly 🥳 Thanks for fixing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug release: canary A release on the canary channel
Projects
None yet
Development

No branches or pull requests

2 participants