fix(nuxt): don't disable vue endpoint in dev mode (#21524)

This commit is contained in:
Daniel Roe 2023-06-11 21:41:22 +01:00 committed by GitHub
parent ce096da965
commit 03186d6d44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -295,7 +295,7 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
handler: resolve(distDir, 'core/runtime/nitro/renderer') handler: resolve(distDir, 'core/runtime/nitro/renderer')
}) })
if (nuxt.options.experimental.noVueServer) { if (!nuxt.options.dev && nuxt.options.experimental.noVueServer) {
nitro.hooks.hook('rollup:before', (nitro) => { nitro.hooks.hook('rollup:before', (nitro) => {
if (nitro.options.preset === 'nitro-prerender') { return } if (nitro.options.preset === 'nitro-prerender') { return }
const nuxtErrorHandler = nitro.options.handlers.findIndex(h => h.route === '/__nuxt_error') const nuxtErrorHandler = nitro.options.handlers.findIndex(h => h.route === '/__nuxt_error')