withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
43.84k stars 2.28k forks source link

Astro doesn't automatically refresh the browser whenever I save changes in .md or .astro files #11325

Closed amiteshore closed 3 days ago

amiteshore commented 4 days ago

Astro Info

Astro                    v4.11.0
Node                     v20.14.0
System                   Linux (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             @astrojs/tailwind

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

No response

Describe the Bug

Browser isn't auto-refershing after I added const pages = await Astro.glob('../pages/python/*.md') in BlogLayout.astro. I manually have to hit reload on the browsers to see the changes.

Before adding const pages = await Astro.glob('../pages/python/*.md'), the astro dev server logs were like this:

19:30:24 [watch] src/pages/python/index.md
19:30:25 [200] /python 13ms

now the astro dev server is not watching the .md and .astro files, and the logs are like this:

20:17:33 [200] /python 8ms
20:24:26 [watch] /node_modules/@astrojs/tailwind/base.css

What's the expected result?

I want the browser to reload automatically whenever I save changes on my code editor.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/withastro-astro-epq2i8?file=src%2Fpages%2Fpython%2Findex.md

Participation

matthewp commented 4 days ago

Astro.glob is deprecated and will likely be removed in a future version. I suggest you switch to using https://docs.astro.build/en/tutorials/add-content-collections/ instead.