Skip to content
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

random port for full static generate #7597

Closed
debs-obrien opened this issue Jun 24, 2020 · 4 comments · Fixed by #7608
Closed

random port for full static generate #7597

debs-obrien opened this issue Jun 24, 2020 · 4 comments · Fixed by #7608

Comments

@debs-obrien
Copy link

Version

v2.13.1

Reproduction link

https://github.com/nuxt/nuxtjs.org/tree/dev

Steps to reproduce

Open any nuxt project and run dev. This will then use port of 3000. Then open a project that uses v2.13 and run generate which will use nuxt build and nuxt export. As port 3000 is already taken you cannot generate your site unless you close the other port.

What is expected ?

should generate a random port if port is in use

What is actually happening?

Nuxt Fatal error
Screenshot 2020-06-24 at 12.41.36.png

This bug report is available on Nuxt community (#c10840)
@manniL
Copy link
Member

manniL commented Jun 25, 2020

cc @hecktarzuli

@pi0 pi0 mentioned this issue Jun 26, 2020
@pi0
Copy link
Member

pi0 commented Jun 26, 2020

Fixed with v2.13.2

@pi0 pi0 closed this as completed Jun 26, 2020
@andre-brdoch
Copy link

How can the random port be retrieved?

@pi0
Copy link
Member

pi0 commented Jul 2, 2020

Hi @andre-brdoch You may use both nuxt.server.listeners or use nuxt.hook('listen', (server, listener) => {})

If wanted more details would be appreciated making a new issue with usage example :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants