-
-
Notifications
You must be signed in to change notification settings - Fork 505
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
11ty.js templates not updating on --watch/serve (Windows, at least) #596
Comments
Great video and description, thanks! I’m almost certain you found a bug. I’d bet this has something to do with the pieces of our code that reset the Node require cache. I’m guessing there is a bug with how this is interpreted in Windows. If you want to start investigating (depending on your familiarity with Node) you can find them by searching the code-base for |
Alright, not sure I'm the best at the bugging, but here we go:
So apparently the cache is never deleted because it's never there, but that's as far as I understand from this haha Any other debugging you'd like me to do? I'm actually going to test this on Glitch.com to see how this behaves and then get back to you 😉 Edit: I've set-up a simple project on Glitch and there all works fine... I'm guessing they run everything on Linux, so this is probably a Windows bug... Oh, what an OS 😔 Edit 2: I now realize there are many delete require.cache in Eleventy's src, so not sure which one I should test for 🤔 |
The cache uses the real location of the module, to delete it, I recommend to
https://nodejs.org/api/modules.html#modules_require_resolve_request_options Maybe I have time next week(end) to take a closer look, test it and provide a PR. I am new to eleventy, but it will replace my own SSG😉 |
Fix require cache cleanup on Windows (#596)
Fixed by #683. This will go up with the next version |
I've also found that updating the layout does not always update the output, though it does always appear to trigger a rebuild with the old (cached?) layout. Rerunning the command manually makes it work. On Mac with Node v14.5.0 |
Same issue that ShaneHusdon is seeing I think, updating a template in |
@zachleat As this issue is closed already, just want to check you have seen these newer comments? Should it new opened as a new issue? It is still occurring for me. |
Also having the same issue on Mac. @ShaneHudson Which command are you rerunning manually to make it work? |
@antoniaat I was just re-running the watch command, not ideal but worked. |
@antoniaat and @ShaneHudson: I noticed this problem (updating templates does not live update the pages using them) happened only when using the plugin When I stopped using that plugin, the live reload issue went away. So it is possible that your issue is not eleventy's fault but some plugin (this one or another one) referenced in the eleventy config. |
I've not touched the project I was having the issue on for a while, so cannot be sure... but think I had no plugins. |
I am experiencing the same issue using Pug templates. Windows 10, Node 18.17.1. Watch sees the change and compiles things, but I see the old version in the browser. Something rather interesting is that using another program to host the dist folder (I am using Live Server plugin of VSCode) works as expected. |
Describe the bug:
Templates written in Javascript are properly watched by Eleventy, but changes made to them don't propagate to resulting
_site
To Reproduce
index.11ty.js
template there;eleventy --serve
in the dirindex.11ty.js
and see if they're reflected in the_site
folderExpected behavior
Say I were to change my layout from
'<h1>Home here</h1>'
to'Home'
, I'd expect_site/index.html
to become solelyhome
.Screenshots
I've actually recorded a video of this behavior here.
Environment:
0.8.3
Additional context
For now I've been simply
eleventy build
ing every time I make a change, but you can imagine how unproductive and upsetting this is... 😔 Oh, and the other templating languages are not an option for my current project.The text was updated successfully, but these errors were encountered: