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

HMR doesn't detect new _data.yml when remote file is specified #633

Closed
wjharney opened this issue Jul 11, 2024 · 2 comments
Closed

HMR doesn't detect new _data.yml when remote file is specified #633

wjharney opened this issue Jul 11, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@wjharney
Copy link

Version

v2.2.2

Platform

macOS

What steps will reproduce the bug?

The expected behavior of HMR is that creating, updating, or deleting any file will result in changes being reflected in
the browser without needing to refresh the page or restart the server. However, when creating or deleting a _data.yml
file that has an associated remote file, the expected changes are not seen unless the server is restarted.

Steps to reproduce

  1. Clone this gist: https://gist.github.com/wjharney/d73914e8e74b77bc3a99e938af33bce9
  2. Run deno task serve to start the server.
  3. Visit http://localhost:3000/posts/hello-world/ to see the post, with the heading "Base Template".
  4. While the server is running, run echo 'layout: layouts/replacement.vto' > posts/_data.yml to change the layout used for the post.
  5. Refresh the page.

Expected Result: The heading should be "Replacement Template".

Actual Result: The heading is "Base Template".

  1. Stop and restart the server. The post now uses the correct template, with the heading "Replacement Template".
  2. Delete posts/_data.yml.
  3. Refresh the page.

Expected Result: The heading should be "Base Template".

Actual Result: Neither template is used; the page only contains the post content, "Hello World".

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

The page should be updated without needing to reload the page or restart the server.

What do you see instead?

The changes aren't reflected unless the server is restarted.

Additional information

  • Updating posts/_data.yml works as expected.
  • Creating a third layout while the server is running and updating the _data.yml to point to that layout works as expected.
  • Creating, updating, or deleting a _data.yml that does not have a remote file associated works as expected.
@wjharney wjharney added the bug Something isn't working label Jul 11, 2024
@oscarotero
Copy link
Member

Indeed, that's a bug.
I'm investigating the best way to fix it. Will be fixed in the next version of Lume.
Thanks!

oscarotero added a commit that referenced this issue Jul 11, 2024
@oscarotero
Copy link
Member

I just uploaded a fix.
If you want to test it, you can upgrade Lume to the latest development version deno task lume upgrade --dev.
It will be available in the next stable version (v2.2.4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants