Home

Issue: 3068

Examples: ensure the readiness of Nuxt

[issue link]

The examples mounts the middleware without waiting for readiness:

https://github.com/nuxt/nuxt.js/blob/d1d637f0c4a55fb68895740ceb97b0e92e07fafd/examples/custom-server/server.js#L13-L22

This applies to our own commands as well.

https://github.com/nuxt/nuxt.js/blob/d1d637f0c4a55fb68895740ceb97b0e92e07fafd/bin/nuxt-start#L54-L83

Although in practice this have never caused an issue, we should document the fact that Nuxt itself is initialized asynchronously, and ensure the readiness before actually starting the server.

This question is available on Nuxt.js community (#c2655)