You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `preview` command starts a server to preview your Nuxt application after running the `build` command. `nuxt start` is the same command under another name. When running your application in production refer to the [Deployment section](/docs/getting-started/deployment).
18
18
19
+
When the configured `server.builder` produces no server at all (a client-only build, for example), there is nothing to run: the static output is served directly instead, with unmatched paths falling back to the client entry so client-side routing works.
20
+
19
21
Some Nitro presets do not produce a server that can be run locally. For those, the preset's own preview command is run instead, and the command tells you what it is running.
outro(`Previewing ${styleText('cyan',relativeToProcess(dir))} at ${styleText('cyan',server.url?.replace(TRAILING_SLASH_RE,'')||'')}`)
119
+
return
120
+
}
121
+
}
122
+
83
123
logger.error(
84
-
`Cannot find ${styleText('cyan','nitro.json')}. Did you run ${styleText('cyan','nuxt build')} first? Search path:\n${nitroJSONPaths.join('\n')}`,
124
+
`Cannot find a build to preview${builderName ? ` for the ${styleText('cyan',builderName)} server builder` : ''}. Did you run ${styleText('cyan','nuxt build')} first? Search path:\n${[...nitroJSONPaths, ...publicDirs].join('\n')}`,
thrownewError('Nitro server has not been initialized.')
1160
+
thrownewActionableError(
1161
+
`The ${styleText('cyan',getServerBuilderName(this.#currentNuxt))} server builder did not provide a dev server.\n`
1162
+
+` A ${styleText('cyan','server.builder')} must expose a \`handler\`, \`fetch\` or \`app\` on \`nuxt.server\` to be served by ${styleText('cyan','nuxt dev')}.`,
0 commit comments