diff --git a/packages/bridge/src/nitro.ts b/packages/bridge/src/nitro.ts index 14ff640f13d..0233bcf2c14 100644 --- a/packages/bridge/src/nitro.ts +++ b/packages/bridge/src/nitro.ts @@ -228,7 +228,7 @@ export async function setupNitroBridge () { nitro.options.handlers.push(...handlers) nitro.options.devHandlers.push(...devHandlers) nitro.options.handlers.unshift({ - route: '/_nitro', + route: '/__nuxt_error', lazy: true, handler: resolve(distDir, 'runtime/nitro/renderer') }) diff --git a/packages/nuxt3/src/core/nitro.ts b/packages/nuxt3/src/core/nitro.ts index 861d442e6b4..dfe41a19641 100644 --- a/packages/nuxt3/src/core/nitro.ts +++ b/packages/nuxt3/src/core/nitro.ts @@ -128,7 +128,7 @@ export async function initNitro (nuxt: Nuxt) { nitro.options.handlers.push(...handlers) nitro.options.devHandlers.push(...devHandlers) nitro.options.handlers.unshift({ - route: '/_nitro', + route: '/__nuxt_error', lazy: true, handler: resolve(distDir, 'core/runtime/nitro/renderer') }) diff --git a/packages/nuxt3/src/core/runtime/nitro/error.ts b/packages/nuxt3/src/core/runtime/nitro/error.ts index 451c658f0d2..b7e30e2f875 100644 --- a/packages/nuxt3/src/core/runtime/nitro/error.ts +++ b/packages/nuxt3/src/core/runtime/nitro/error.ts @@ -29,7 +29,7 @@ export default async function handleError (error: any, event: CompatibilityEvent } // HTML response - const url = withQuery('/_nitro/__error', errorObject as any) + const url = withQuery('/__nuxt_error', errorObject as any) const html = await $fetch(url).catch(() => errorObject.statusMessage) event.res.setHeader('Content-Type', 'text/html;charset=UTF-8') diff --git a/packages/nuxt3/src/core/runtime/nitro/renderer.ts b/packages/nuxt3/src/core/runtime/nitro/renderer.ts index 2a46e5d45fe..b59525afcc1 100644 --- a/packages/nuxt3/src/core/runtime/nitro/renderer.ts +++ b/packages/nuxt3/src/core/runtime/nitro/renderer.ts @@ -73,7 +73,7 @@ function renderToString (ssrContext) { export default eventHandler(async (event) => { // Whether we're rendering an error page - const ssrError = event.req.url?.startsWith('/__error') ? useQuery(event) : null + const ssrError = event.req.url?.startsWith('/__nuxt_error') ? useQuery(event) : null let url = ssrError?.url as string || event.req.url! // payload.json request detection