Open walteh opened 2 months ago
update, it remains an issue on
bun: 1.1.20+ae1948925
os: Darwin 24.0.0 arm64 arm
/ Version 15.0 Beta (24A5289h)
- Sequoia Beta 3
update, it remains an issue on
bun: 1.1.21+70ca2b76c
vite: 5.3.5
os: Darwin 24.1.0 arm64 arm
/ Version 15.1 Beta (24B5009l)
- Sequoia
I've started seeing this issue too after removing nodejs, in an effort to solely use bun.
error when starting dev server:
ENAMETOOLONG: File name too long
at readFile (native)
at <anonymous> (/Users/Matt/Downloads/test/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:45485:16)
at readFileIfExists (/Users/Matt/Downloads/test/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:45483:33)
at <anonymous> (/Users/Matt/Downloads/test/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:45477:5)
at resolveHttpsConfig (/Users/Matt/Downloads/test/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:45473:35)
at <anonymous> (/Users/Matt/Downloads/test/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:62630:30)
at processTicksAndRejections (:12:39)
bun: 1.1.24
vite: 5.4.0
os: 15.1 Beta (Dev 2) (24B5024e)
os: MacOS Sonoma 14.6.1 arch: arm64 vite: 5.4.2 bun: 1.1.27
After tracing the issue it can be isolated to the following deviation. Whenever the filename that exceeds the max? length is passed to readFile()
from "node:fs/promises" module bun throws immediate error but node instead returns a rejected promise.
Can be reproduced by running in bun and node the script:
const {readFile} = require("node:fs/promises");
const longFileName = "./" + "x".repeat(1024);
readFile(longFileName).catch(() => console.log("Rejected promise"));
Oh interesting, it sounds like we need to wrap it in an exception handler that returns a Promise rejection
What version of Bun is running?
1.1.18+5a0b93523
What platform is your computer?
Darwin 24.0.0 arm64 arm
What steps can reproduce the bug?
Use a mac with macOS 15 (Sequoia) installed
Follow the same steps as documented here: https://bun.sh/guides/ecosystem/vite
For the options, I selected React & Typescript + SWC
The problem shows up when you try to do:
bunx --bun vite
What is the expected behavior?
I pulled this from another mac running the same vite and bun versions, but on a different os -
Darwin 23.5.0 arm64 arm
What do you see instead?
Additional information
The Vite version I am using is
v5.3.3
, which is just the latest stable as of today.I thought it might be related to https://github.com/oven-sh/bun/issues/10356, but not sure. Strange that it shows up only on the Sequoia beta.