Version
Reproduction link
https://gitlab.com/jryancasas/nuxtjs-2.13-issue-with-nuxt-generate
Steps to reproduce
Create a new nuxt project, either using nuxt-edge@2.13
, or by cloning the repo provided. Then:
# install dependencies
$ yarn install
# build for production (target: server by default)
$ yarn nuxt build
# Try to nuxt generate without rebuilding
$ yarn nuxt generate --no-build --port 7777
What is expected ?
Nuxt should be able to generate the website as it does on 2.12
What is actually happening?
i Modern bundles are detected. Modern mode (server) is enabled now. 19:30:33
FATAL In order to use nuxt export, you need to run nuxt build --target static 19:30:34
at Generator.initiate (node_modules\@nuxt\generator-edge\dist\generator.js:160:15)
╭────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ ✖ Nuxt Fatal Error │
│ │
│ Error: In order to use `nuxt export`, you need to run `nuxt build --target static` │
│ │
╰────────────────────────────────────────────────────────────────────────────────────────╯
error Command failed with exit code 1.
This PR should fix it: #7523