docs: Highlight option to opt in to use bun runtime over node default - #14286
docs: Highlight option to opt in to use bun runtime over node default#14286eugengi wants to merge 1 commit into
bun runtime over node default#14286Conversation
Inform users to opt in to use Bun as a runtime for the dev server and build. Add associate dev server and build commands. [Note] - This is documented in the official Astro integration guides from Bun. [Docs] - https://bun.com/docs/guides/ecosystem/astro#build-an-app-with-astro-and-bun
|
Hello! Thank you for opening your first PR to Astro’s Docs! 🎉 Here’s what will happen next:
|
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
|
Thanks for the PR @eugengi! Astro doesn’t officially support running with Bun instead of the Node runtime currently, so we intentionally don’t document this. |
|
Thanks for the head-ups @delucis. I've seen people in the community pull off Astro with Bun as a runtime. |
|
Yeah, some people are able to use it successfully, but there are issues due to Bun not yet having reached it’s goal of full Node compatibility. I think we should maybe clarify the warning at the top of the page: https://docs.astro.build/en/recipes/bun/ It currently says “Using Bun with Astro may reveal rough edges,” but we should probably clarify specifically that the runtime is the riskiest part. AFAIK using the |
There are a couple of Astro-related issues on bun. I didn't go through each, but got AI to analyze the issues. The majority are runtime-specific with recurring themes around: dev server crashes (tied to Babel), failing config reloads, native binary compatibility, and runtime API issues. I'd argue it's safe to rely on Bun for installs/resolutions (package manager), which is outside the full Node-compatibility issue you highlighted |
Good call! The claim in the docs is a bit broad. I can follow up with a new PR for this! @delucis lmk your thoughts |
|
Sure! It would only need a very minimal edit to that caution I think to clarify it. |

Description
Minor addition to the docs to inform users to opt in to use Bun as a runtime for the dev server, builds, and previews.
By default, Bun respects the Node shebang (#!/usr/bin/env node) found at the top of executable files and automatically passes execution over to the system's Node.js runtime. To bypass this and force execution inside the Bun runtime, you must use the
--bunflagNote
This option is described in the official Bun recipe docs but is missing in the corresponding Astro docs.
Docs
References
N/AN/Alatest@sweugene