ENOENT on startup using Bun 1.2.20 and Nuxt 4 on Windows
Hi, I just created a project with Nuxt 4 using bun as package manager / runtime. It's pretty much a test to see if I could make use of some Bun APIs with certain libraries without having to play around with my whole application.
While doing so, I did the usual to create and launch the application, just making sure to use
bun --bun run dev
so it used Bun as runtime. Yet I got the ENOENT error.
Steps to reproduce:
Run log:
2 Replies
Hi @Kailthyr. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
The ENOENT error you’re encountering when running a Nuxt 4 project with Bun as the runtime on Windows (specifically,
- “As a patch, either rollback to Bun
- “I installed node. All good. thanks anyway”
- Multiple users confirm that switching to Node.js or ensuring Node.js is present resolves the issue, and that the problem is specific to Bun’s handling of sockets on Windows and Linux environments
Nuxt dev server issues Summary The ENOENT error when running Nuxt 4 with Bun as the runtime on Windows is a known compatibility issue. The recommended workaround is to use Node.js as the runtime, or ensure Node.js is installed alongside Bun. Rolling back to an earlier Bun version may also help, but is not guaranteed. This is a Bun-specific issue and not a general Nuxt bug. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
ENOENT: no such file or directory, listen '\\.\pipe\nuxt-dev-2243.sock'
) is a known issue that has been reported by several users. This error typically appears when using Bun as the runtime for Nuxt development, especially on Windows systems.
What’s Happening?
- The error is related to Bun’s compatibility with Nuxt’s dev server, particularly with how it handles socket files on Windows.
- Multiple users have reported similar issues, including ENOENT
and related socket errors, when using Bun as the runtime for Nuxt 4 projects on both Linux and Windows. The problem seems to be more prevalent or only reproducible with Bun, and not with Node.js as the runtime.
- In some cases, users also experienced related errors like Malformed_HTTP_Response
and HMR (Hot Module Replacement) failures when using Bun, which were resolved by switching to Node.js as the runtime or by ensuring Node.js is installed alongside Bun so that Bun can "piggyback" off Node’s APIs on Windows and Linux systems.
Workarounds
- Use Node.js as the runtime: The most reliable workaround is to use Node.js instead of Bun to run your Nuxt dev server. This avoids the socket compatibility issues entirely.
- Install Node.js alongside Bun: Some users found that simply having Node.js installed on the system (even if using Bun as the package manager) resolved the issue, as Bun can utilize Node’s APIs for certain operations.
- Rollback Bun version: As a temporary patch, rolling back to Bun version 1.1.45
has been suggested by users who experienced similar issues, though this may not be a long-term solution as Nuxt and Bun continue to evolve.
- Wait for upstream fixes: The issue has been acknowledged as a Bun bug, and improvements may come in future releases of Bun or Nuxt’s compatibility layer for Bun.
References from Knowledge Sources
- “This has been reported as a bun bug. (Assuming that's your situation, you can work around by not using --bun
.)”- “As a patch, either rollback to Bun
1.1.45
or install Node so that Bun can piggy back off of it.”- “I installed node. All good. thanks anyway”
- Multiple users confirm that switching to Node.js or ensuring Node.js is present resolves the issue, and that the problem is specific to Bun’s handling of sockets on Windows and Linux environments
Nuxt dev server issues Summary The ENOENT error when running Nuxt 4 with Bun as the runtime on Windows is a known compatibility issue. The recommended workaround is to use Node.js as the runtime, or ensure Node.js is installed alongside Bun. Rolling back to an earlier Bun version may also help, but is not guaranteed. This is a Bun-specific issue and not a general Nuxt bug. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
<@1392741402458329279> Kapa.ai is still learning and improving, please let me know how I did by reacting below.