withastro / astro

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

`bunx --bun astro dev` does not reload configuration #11762

Closed RichDom2185 closed 1 month ago

RichDom2185 commented 1 month ago

Astro Info

Astro                    v4.13.3
Node                     v22.3.0
System                   macOS (arm64)
Package Manager          bun
Output                   static
Adapter                  none
Integrations             @astrojs/mdx
                         @astrojs/sitemap
                         @astrojs/react
                         @astrojs/tailwind

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

No response

Describe the Bug

Astro Docs suggests the use of the --bun flag when running commands to use the Bun runtime over Node:

bunx --bun astro dev

Change the configuration file (e.g. change the server port, but could be anything that gives a noticeable change):

 // https://astro.build/config
 export default defineConfig({
+  server: {
+    port: 2000,
+  },
   site: 'https://example.com',
   integrations: [mdx(), sitemap(), react(), tailwind()],
   markdown: {

Logs are printed:

23:42:30 Configuration file updated. Restarting...

But the changes don't actually take effect. The server still resides on port 4321.

Likewise for any other change to astro.config.mjs

Tested using Bun v1.1.8 and v1.1.24 (latest at the time of writing).

What's the expected result?

It should actually restart and update the configuration.

# This works fine
bunx astro dev
# This works fine too, as expected
yarn astro dev

Link to Minimal Reproducible Example

NA (any example works, even the minimal example)

Participation

Princesseuh commented 1 month ago

We do not support Bun, please create an issue on their repo.

RichDom2185 commented 1 month ago

We do not support Bun

Ok, I've filed the issue in https://github.com/oven-sh/bun/issues/13391. Why is bun in the official Astro Docs though (link, also in issue description)? It's even listed under Official Recipes.

ematipico commented 1 month ago

We do not support Bun

Ok, I've filed the issue in https://github.com/oven-sh/bun/issues/13391. Why is bun in the official Astro Docs though (link, also in issue description)? It's even listed under Official Recipes.

Bun is a drop-in replacement for Node.js, so if something that works for Node.js, doesn't work for bun, it means that it's a bug in bun.

It's always been like this since bun was launched, and what Jarred said.