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 does not work when editing markdown / .md files. #8378

Closed
1 task
davidbernegger opened this issue Sep 2, 2023 · 3 comments · Fixed by #8418
Closed
1 task

HMR does not work when editing markdown / .md files. #8378

davidbernegger opened this issue Sep 2, 2023 · 3 comments · Fixed by #8418
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority) feat: hmr Related to HMR (scope)

Comments

@davidbernegger
Copy link

davidbernegger commented Sep 2, 2023

Astro Info

Astro                    v3.0.7
Node                     v18.15.0 / v20.3.1 (tried both)
System                   macOS (arm64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

HMR does not work on Astro 3.0.7 when editing .md files in the pages directory. Astro does recognise the change, as it shows [astro] reload /src/pages/markdown.md whenever i save, but the browser does not refresh unlike the .astro files. In the Minimal reproducible example, navigate to the markdown page and try to edit it.

What's the expected result?

The browser should refresh with the current content

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-ve9ttx?file=src%2Fpages%2Fmarkdown.md

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Sep 2, 2023
@davidbernegger davidbernegger changed the title HMR does not work when editing MD files. HMR does not work when editing markdown / .md files. Sep 2, 2023
@lloydjatkinson
Copy link
Contributor

Did you try with the markdown file in /content, as part of content collections?

@davidbernegger
Copy link
Author

davidbernegger commented Sep 2, 2023

Yeah, this works, but putting .md in the pages directory is supported according to the official documentation, changed the description to make it more specific.

@bluwy bluwy added - P4: important Violate documented behavior or significantly impacts performance (priority) feat: hmr Related to HMR (scope) and removed needs triage Issue needs to be triaged labels Sep 5, 2023
@bluwy
Copy link
Member

bluwy commented Sep 5, 2023

Looks like it's happening since 3.0.0-beta.2, works in beta.0 (beta.1 has a faulty dep)

The issue seems to be that the Vite client script to handle HMR is missing in the HTML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority) feat: hmr Related to HMR (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants