"bun run dev" is not working.
Hi' there.
My error log is here.
I thinks this is from something wrong in file watch system.
OS is MAC (Sequoia 15.3.2)
Nuxt version is 3.14.1592.
Bun version is 1.2.5.
Is same error in Nuxt 3.16.1 and Bun 1.1.6.
Anyone know about fix this error?
5 Replies
Hi @Lovefield. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the error logs you've shared, you're experiencing an issue with file watching when running Nuxt with Bun on macOS Sequoia. This appears to be related to known issues with file system watchers in Nuxt development mode.
From the knowledge sources, there are several similar issues reported with Nuxt development servers on macOS:
1. In one case, users reported that HMR (Hot Module Replacement) was extremely slow in Nuxt 3.14.1592, with file changes triggering excessive reloads GitHub Issue #30290.
2. Another user reported "too many open files" errors on macOS Sonoma/Sequoia when running Nuxt with Capacitor GitHub Issue #12376.
Here are some potential solutions you can try:
1. Change the file watcher
You can try switching to the
parcel
watcher instead of the default one. Several users reported this fixed similar issues on macOS:
2. Ignore directories with many files
If you have directories with many files that don't need to be watched:
3. Disable Spotlight indexing
One user mentioned that disabling Spotlight indexing for their project directory resolved similar issues on macOS.
4. Clean installation
Try removing these directories and reinstalling dependencies:
- Delete .nuxt
directory
- Delete .output
directory
- Delete node_modules
directory
- Delete lockfile (package-lock.json, yarn.lock, or pnpm-lock.yaml)
- Reinstall dependencies
This approach helped some users with similar socket-related errors GitHub Issue #31253.
5. Try a different Node.js version
Some users reported success by switching to a different Node.js version. You might want to try Node.js v20 or v23.9.
If none of these solutions work, you might want to consider using npm or yarn instead of Bun until this specific issue is resolved in a future update.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@370382517720580099> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@kapa.ai It's working! but other problem. In docker container. It's working, but nothing response. no error, no log.
Let me check the knowledge base for you again. One moment! :books:
----------------------
I'm glad to hear that your initial issue is resolved! Now you're facing a new problem with your Nuxt application in a Docker container where it's running but not responding or producing logs.
Based on the knowledge sources, this is a common issue when running Nuxt in Docker containers. Here are some potential solutions:
1. Configure Nuxt to accept external connections
The most likely issue is that Nuxt is only listening on localhost inside the container. By default, Nuxt only accepts connections from the host machine, which prevents external access from Docker's network:
Or in your nuxt.config.js/ts:
As mentioned in this Stack Overflow answer, this is a common issue when dockerizing Nuxt applications.
2. Check network configuration in Docker Compose
If you're using Docker Compose, ensure your services are on the same network and properly configured:
3. Verify your ENTRYPOINT in Dockerfile
Make sure your Dockerfile has the correct entrypoint for Nuxt 3:
4. Volume mounting issues
If you're using volumes in development mode, they might be overriding your built files. As seen in this Stack Overflow post, volumes can cause the
.output
directory to be missing:
5. Check for server/client URL mismatches
If your application makes API calls, there might be a mismatch between server and client URLs. As shown in this Stack Overflow post, you may need to configure different URLs for server and client contexts:
Debugging steps
1. Try running the container with interactive mode to see any console output:
2. Check if the container is actually listening on port 3000:
3. Verify that your environment variables are correctly passed to the container using:
If you need more specific help, please share your Dockerfile and docker-compose.yml (if you're using it) so I can provide more targeted assistance.
Let me know if any of these solutions work for you!
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@370382517720580099> Kapa.ai is still learning and improving, please let me know how I did by reacting below.