From 631be3a1ddada97454dab8cd20810864196e1067 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Fri, 8 May 2020 16:37:42 +0200 Subject: [PATCH] fix(generator): improve error handling when build does not exists (#7335) [release] --- packages/generator/src/generator.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/generator/src/generator.js b/packages/generator/src/generator.js index a0e504f1ae..485ef8aeae 100644 --- a/packages/generator/src/generator.js +++ b/packages/generator/src/generator.js @@ -66,10 +66,11 @@ export default class Generator { await this.builder.build() this.isFullStatic = isFullStatic(this.options) } else { - const hasBuilt = await fsExtra.exists(this.srcBuiltPath) + const hasBuilt = await fsExtra.exists(path.resolve(this.options.buildDir, 'dist', 'server', 'client.manifest.json')) if (!hasBuilt) { + const fullStaticArgs = isFullStatic(this.options) ? ' --target static' : '' throw new Error( - `No build files found in ${this.srcBuiltPath}.\nPlease run \`nuxt build --target static\` before calling \`nuxt export\`` + `No build files found in ${this.srcBuiltPath}.\nPlease run \`nuxt build${fullStaticArgs}\` before calling \`nuxt export\`` ) } const config = this.getBuildConfig()