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

Possibly incorrect output when _includes is created while the dev server is running (v2.0.0-canary.23) #2723

Closed
yurivish opened this issue Jan 1, 2023 · 4 comments
Assignees
Labels
bug: --serve restart Changes to projects shouldn’t need to restart dev server bug release: canary A release on the canary channel

Comments

@yurivish
Copy link

yurivish commented Jan 1, 2023

Operating system

macOS Monterey 12.6.2

Eleventy

v2.0.0-canary.23

Describe the bug

Hello! I'm trying out 11ty for a new static site and noticed an odd behavior.

It doesn't reproduce on 1.0, so this might be expected at this point in the development of 2.0. I wasn't sure how close a "canary" build is to release and was excited to try out 2.0, so please feel free to close if this is known or expected.

It seems that directories created while the dev server is running are sometimes treated differently than if they were created before the dev server was started.

I noticed this as I was following along with a "Getting started" tutorial and created the _include folder while the dev server was running.

Reproduction steps

Here's a standalone reproduction on the latest canary build (v2.0.0-canary.23):

$ mkdir bug
$ cd bug
$ pnpm install --save-dev @11ty/eleventy@canary
Already up to date
Progress: resolved 211, reused 211, downloaded 0, added 0, done
Done in 4.3s
$ npx @11ty/eleventy --serve
[11ty] Wrote 0 files in 0.03 seconds (v2.0.0-canary.23)
[11ty] Watching…
[11ty] Server at http://localhost:8080/
[11ty] File added: _includes/post.md
[11ty] Writing _site/_includes/post/index.html from ./_includes/post.md (liquid)
[11ty] Wrote 1 file in 0.05 seconds (v2.0.0-canary.23)
[11ty] Watching…

In another terminal, while the dev server runs:

yurivish@Compy ~ % cd bug
$ mkdir _includes
$ echo "# Title" > _includes/post.md

At this point, the dev server will print

[11ty] File added: _includes/post.md
[11ty] Writing _site/_includes/post/index.html from ./_includes/post.md (liquid)
[11ty] Wrote 1 file in 0.05 seconds (v2.0.0-canary.23)

If I then stop the dev server, delete the output folder, then restart the dev server, it does not regenerate the _site output from before:

$ rm -rf _site
$ npx @11ty/eleventy --serve
[11ty] Wrote 0 files in 0.03 seconds (v2.0.0-canary.23)
[11ty] Watching…
[11ty] Server at http://localhost:8080/

Which I think shows that files created while the dev server is active are not always treated the same as if they already existed.

Expected behavior

The same output should be generated regardless of whether or not the dev server happens to be running as the site is being edited.

✏️ Edit: I also noticed that in another simple set up with a Markdown file and HTML template, using --serve or --watch would update the output when the Markdown file changed but not when the HTML template changed. The update would happen, but changes from the new template would not be applied:

Edit 2: The incremental docs do say "Layouts Coming soon in v2.0.0-canary.21. When you change a layout file, any templates using that layout file are rebuilt." So it does sound like the behavior I'm describing is not intended.

[11ty] File changed: _includes/index.html
[11ty] Writing _site/first-post/index.html from ./first-post.md (liquid)

I also tried this in 1.0 where the same workflow works correctly, so it might be a regression in the current canary version.

Reproduction URL

No response

Screenshots

No response

@yurivish yurivish changed the title Possibly incorrect output when _include is created while the dev server is running Possibly incorrect output when _includes is created while the dev server is running Jan 1, 2023
@yurivish yurivish changed the title Possibly incorrect output when _includes is created while the dev server is running Possibly incorrect output when _includes is created while the dev server is running (v2.0.0-canary.23) Jan 1, 2023
@zachleat zachleat added bug bug: --serve restart Changes to projects shouldn’t need to restart dev server and removed needs-triage labels Jan 9, 2023
@zachleat
Copy link
Member

zachleat commented Jan 9, 2023

Ah, I agree! And did reproduce this—moving to bug status

@zachleat zachleat added this to the Eleventy 2.0.0 milestone Jan 10, 2023
@zachleat zachleat added the release: canary A release on the canary channel label Jan 10, 2023
@zachleat zachleat self-assigned this Jan 10, 2023
@zachleat
Copy link
Member

Definitely a regression, this will ship with 2.0.0-canary.28

@yurivish
Copy link
Author

Thank you!

@zachleat
Copy link
Member

v2.0.0-canary.28 is out! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: --serve restart Changes to projects shouldn’t need to restart dev server bug release: canary A release on the canary channel
Projects
None yet
Development

No branches or pull requests

2 participants