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

template dependency changes not propagating through to built output #3338

Closed
marisademeglio opened this issue Jun 27, 2024 · 4 comments
Closed
Labels

Comments

@marisademeglio
Copy link

marisademeglio commented Jun 27, 2024

Operating system

macOS Sonoma 14.5 (23F79)

Eleventy

@11ty/eleventy ^3.0.0-alpha.13

Describe the bug

My markdown file index.md uses a layout file _includes/layouts/html.11ty.js which in turn references _includes/components/table.11ty.js.

When I change either .11ty.js file, it triggers a a rebuild and the console output reports:

[11ty] File changed: _includes/components/table.11ty.js
  Eleventy Restarting +52s
...
...
Eleventy:Logger Writing ./_site/index.html from ./content/index.md (liquid) +52s
Eleventy:Template ./_site/index.html written. +3ms

But in this case, the resulting HTML file does not reflect the changes to table.11ty.js. However, if I instead edit html.11ty.js, it reflects changes to that file (but still does not show the latest from the table component).

Both 11ty.js files are nested at the same depth inside _includes and nothing is explicitly mentioned in the configuration regarding watch targets. I just rely on the built-in behavior of monitoring the _includes directory.

Reproduction steps

  1. Start project cross-env DEBUG=Eleventy* eleventy --serve
  2. Edit _includes/components/table.11ty.js
  3. Inspect _site/index.html and see the changes are not there

Expected behavior

I expect that the edit would be reflected in the output without having to restart eleventy.

Reproduction URL

https://github.com/marisademeglio/eleventy-issue-3338

Screenshots

No response

@zachleat
Copy link
Member

Almost certain this is a duplicate of #3270, which shipped with 3.0.0-alpha.14. Can you upgrade and retest?

@zachleat zachleat added this to the Eleventy 3.0.0 milestone Jun 27, 2024
@marisademeglio
Copy link
Author

Almost certain this is a duplicate of #3270, which shipped with 3.0.0-alpha.14. Can you upgrade and retest?

I saw that one right after I hit submit, via #3337! But unfortunately after upgrading I don't see any changes.

❯ ./node_modules/.bin/eleventy --version
3.0.0-alpha.14

I cleared _site and restarted. Output is as before, where it "sees" the change and rewrites the file but the component template changes aren't showing up. Let me know if I can try anything else.

[11ty] File changed: _includes/components/table.11ty.js
  Eleventy Restarting +12s
  Eleventy:TemplatePassthroughManager Resetting counts to 0 +12s
  Eleventy:EleventyFiles .gitignore,.eleventyignore,content/.eleventyignore ignoring: ./node_modules/** +12s
  Eleventy:EleventyFiles .gitignore,.eleventyignore,content/.eleventyignore ignoring: ./_site/** +0ms
  Eleventy:EleventyFiles .gitignore,.eleventyignore,content/.eleventyignore ignoring: ./.vscode/launch.json +0ms
  Eleventy:Util:ProjectTemplateFormats Using configuration `templateFormats`, `setTemplateFormats()`, `addTemplateFormats()`: [ 'md' ] +12s
  Eleventy:TemplatePassthroughManager Resetting counts to 0 +0ms
  Eleventy:EleventyFiles .gitignore,.eleventyignore,content/.eleventyignore ignoring: ./node_modules/** +1ms
  Eleventy:EleventyFiles .gitignore,.eleventyignore,content/.eleventyignore ignoring: ./_site/** +0ms
  Eleventy:EleventyFiles .gitignore,.eleventyignore,content/.eleventyignore ignoring: ./.vscode/launch.json +0ms
  Eleventy Directories:
  Eleventy   Input:
  Eleventy     Directory: ./content/
  Eleventy     File: false
  Eleventy     Glob: false
  Eleventy   Data: ./_data/
  Eleventy   Includes: ./_includes/
  Eleventy   Layouts: false
  Eleventy   Output: ./_site/
  Eleventy Template Formats: md
  Eleventy Verbose Output: false +1ms
  Eleventy:EleventyFiles Searching for: [ './content/**/*.md' ] +0ms
  Eleventy:FastGlobManager Glob search ('templates') searching for: [ './content/**/*.md' ] +12s
  Eleventy:FastGlobManager Glob search ('templates') ignoring: [ 'node_modules/**', '_site/**', '.vscode/launch.json', '_includes/**', '_data/**', '**/node_modules/**', '.git/**' ] +0ms
  Eleventy:TemplatePassthroughManager TemplatePassthrough copy started. +1ms
  Eleventy:TemplatePassthroughManager `addPassthroughCopy` config API paths: { css: { outputPath: true, copyOptions: {} } } +1ms
  Eleventy:TemplatePassthroughManager `addPassthroughCopy` config API normalized paths: [ { inputPath: './css', outputPath: true, copyOptions: {} } ] +0ms
  Eleventy:TemplatePassthroughManager TemplatePassthrough copying from config: { inputPath: './css', outputPath: true, copyOptions: {} } +0ms
  Eleventy:TemplatePassthrough Copying './css/' +12s
  Eleventy:TemplateData Using [ '.11tydata', '' ] suffixes to find data files. +12s
  Eleventy:TemplateData getLocalDataPaths('./content/index.md'): [ './content/index.11tydata.js', './content/index.11tydata.cjs', './content/index.11tydata.mjs', './content/index.11tydata.json', './content/index.json', './content/content.11tydata.js', './content/content.11tydata.cjs', './content/content.11tydata.mjs', './content/content.11tydata.json', './content/content.json' ] +0ms
  Eleventy:ImportJsonSync Found 'package.json' searching parent directories at: '/Users/marisa/dev/sandbox/bug/eleventy-issue-3338' +12s
  Eleventy:FastGlobManager Glob search ('global-data') searching for: [ './_data/**/*.{json,mjs,cjs,js}' ] +2ms
  Eleventy:TemplateData Found global data file ./_data/stats.json and adding as: stats +1ms
  Eleventy:Template Template date: using file’s 'birthtimeMs' for './content/index.md' of 2024-06-25T17:31:19.622Z (from 1719336679622.955) +12s
  Eleventy:TemplateMap Caching collections objects. +12s
  Eleventy:TemplateMap Collection: collections.all size: 1 +0ms
  Eleventy:TemplateMap Collection: collections.all size: 1 +0ms
  Eleventy:TemplateWriter Template map created. +12s
  Eleventy:Transforms Running '@11ty/eleventy-bundle' transform on './content/index.md': './_site/index.html' +12s
  Eleventy:Transforms Running '@11ty/eleventy/html-transformer' transform on './content/index.md': './_site/index.html' +0ms
  Eleventy:Logger Writing ./_site/index.html from ./content/index.md (liquid) +12s
  Eleventy:Template ./_site/index.html written. +1ms
  Eleventy:TemplatePassthrough Copying individual file 'css/style.css' +4ms
  Eleventy:TemplatePassthroughManager Copied './css' (1 files) +5ms
  Eleventy:TemplatePassthroughManager TemplatePassthrough copy finished. Current count: 1 +0ms
  Eleventy:Benchmark Benchmark      1ms  11%     1× (Aggregate) Passthrough Copy File +12s
[11ty] Copied 1 file / Wrote 1 file in 0.01 seconds (v3.0.0-alpha.14)
  Eleventy Finished writing templates. +7ms
  Eleventy
  Eleventy Have a suggestion/feature request/feedback? Feeling frustrated? I want to hear it!
  Eleventy Open an issue: https://github.com/11ty/eleventy/issues/new +0ms
  Eleventy:FastGlobManager Glob search ('js-dependencies') searching for: [ './content/**/*.11tydata.js' ] +6ms
  Eleventy:FastGlobManager Glob search ('js-dependencies') ignoring: [ '**/node_modules/**' ] +0ms
  Eleventy:Logger Watching… +4ms
  Eleventy:DevServer / { statusCode: 200, filepath: '_site/index.html' } +12s
  Eleventy:DevServer /css/style.css { statusCode: 200, filepath: '_site/css/style.css' } +17ms

@zachleat zachleat added bug and removed duplicate labels Jun 27, 2024
@zachleat
Copy link
Member

You’re right—it’s a bug! Milestoning to 3.0

@zachleat
Copy link
Member

Dependencies weren’t being invalidated when used in an 11ty.js Layout file, so it was a problem in our layout caching (not the JS piece as I expected!)

Shipping with 3.0.0-alpha.15

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

No branches or pull requests

2 participants