Nuxt.js: random port for full static generate

Created on 24 Jun 2020  路  4Comments  路  Source: nuxt/nuxt.js

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)
bug-report

All 4 comments

cc @hecktarzuli

Fixed with v2.13.2

How can the random port be retrieved?

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 :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gary149 picture gary149  路  3Comments

VincentLoy picture VincentLoy  路  3Comments

nassimbenkirane picture nassimbenkirane  路  3Comments

vadimsg picture vadimsg  路  3Comments

o-alexandrov picture o-alexandrov  路  3Comments