-
Notifications
You must be signed in to change notification settings - Fork 9
fix(dev): take the next registered port when 3000 is busy #159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
Repository: druxt/quickstart
Length of output: 50373
🏁 Script executed:
Repository: druxt/quickstart
Length of output: 48206
🌐 Web query:
Nuxt 2.15.8 dev server busy port fallback strict port option server.listen💡 Result:
In Nuxt 2.15.8, there is no built-in "strict port" option or automatic port fallback behavior for the dev server [1][2][3]. When you configure the server port in nuxt.config.js using the server property, Nuxt attempts to bind to that specific port [1][4][5]. If the port is already in use, the process will typically fail with an "EADDRINUSE" error [6]. Key details regarding Nuxt 2.15.8 server configuration: 1. Server Configuration: You can define the port and host in your nuxt.config.js file [1][3]: export default { server: { port: 8000, // default: 3000 host: '0.0.0.0' } } 2. Random Port Assignment: If you explicitly set the port to the string value '0' (not the number 0, which is falsy), Nuxt will assign a random available port to your application [7][5]. 3. Lack of Strict Port/Fallback: Unlike some modern bundlers or frameworks that offer a strictPort option or automatic incrementing when a port is busy, Nuxt 2 does not natively implement this [1][5]. If you require behavior where the server checks for an available port or fails gracefully, you would need to implement a custom server implementation or use a wrapper script to check port availability before launching Nuxt [8][9]. 4. Priority: Environment variables (HOST, PORT, NUXT_HOST, NUXT_PORT) generally take precedence over settings defined in the nuxt.config.js file [7][5]. Developers often use these environment variables in their package.json scripts or CI/CD pipelines to dynamically set ports without modifying the config file [7][5]. For issues where settings in nuxt.config.js appear to be ignored, verify whether environment variables are overriding them, or if you are using newer tools (like nuxi in Nuxt Bridge) that might handle configuration differently than standard Nuxt 2 [9][7].
Citations:
🏁 Script executed:
Repository: druxt/quickstart
Length of output: 3251
🏁 Script executed:
Repository: druxt/quickstart
Length of output: 10617
Eliminate Nuxt’s random-port fallback.
resolveFrontendPort()only probes the port. Nuxt 2.15.8 retries on port0after a laterEADDRINUSE, so it can bind an unregistered random port and break OAuth login. Nuxt 2 has nostrictPortoption. Use a custom listener handoff or terminate instead of allowing the fallback.🤖 Prompt for AI Agents