Skip to content

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

@wjharney

Description

@wjharney

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions