Open ynhhoJ opened 2 months ago
I confirmed this issue occurs with the --bun
flag, but goes away when running bun run dev
. I'm not super familiar with the difference, but it sounds like bun switches back to node.js for Vite projects when --bun
is omitted?
@bholmesdev , https://bun.sh/docs/cli/run#bun :
By default, Bun respects this shebang and executes the script with node. However, you can override this behavior with the
--bun
flag. For Node.js-based CLIs, this will run the CLI with Bun instead of Node.js.
Update: we've found this issue is actually related to request.clone()
dropping the response body. We see this is being tracked separately by Bun: https://github.com/oven-sh/bun/issues/6348
Should be safe to close this PR as a duplicate. Hope Bun can prioritize a fix on this!
What version of Bun is running?
1.1.18+5a0b93523
What platform is your computer?
Linux 6.9.6-200.fc40.x86_64 x86_64 unknown
What steps can reproduce the bug?
bun i
bun run --bun dev
localhost:4321
Will return: Error: Unable to get API context.
What is the expected behavior?
There is no
Unexpected end of JSON input
error and is returned an actual response (77
)npm run dev
:What do you see instead?
Image
![image](https://github.com/withastro/astro/assets/22500212/77b73697-a23a-426c-864c-612ed54c5f74)Additional information
https://github.com/withastro/astro/issues/11423