diff --git a/packages/nuxt/src/app/nuxt.ts b/packages/nuxt/src/app/nuxt.ts index bb7d2a25d9..e317f7908e 100644 --- a/packages/nuxt/src/app/nuxt.ts +++ b/packages/nuxt/src/app/nuxt.ts @@ -266,7 +266,7 @@ export function createNuxtApp (options: CreateOptions) { // Expose payload types nuxtApp.ssrContext._payloadReducers = {} // Expose current path - nuxtApp.payload.path = nuxtApp.ssrContext.event.path + nuxtApp.payload.path = nuxtApp.ssrContext.url } // Expose to server renderer to create payload nuxtApp.ssrContext = nuxtApp.ssrContext || {} as any diff --git a/packages/nuxt/src/core/runtime/nitro/renderer.ts b/packages/nuxt/src/core/runtime/nitro/renderer.ts index 572d207ba8..a2a93fbfc0 100644 --- a/packages/nuxt/src/core/runtime/nitro/renderer.ts +++ b/packages/nuxt/src/core/runtime/nitro/renderer.ts @@ -127,7 +127,7 @@ const getSPARenderer = lazyCachedFunction(async () => { const renderToString = (ssrContext: NuxtSSRContext) => { const config = useRuntimeConfig() ssrContext!.payload = { - path: ssrContext.event.path, + path: ssrContext.url, _errors: {}, serverRendered: false, data: {},