fix(nuxt): do not embed error path in payload (#21671)

This commit is contained in:
Daniel Roe 2023-06-21 11:04:44 +01:00 committed by GitHub
parent c3c56c14ab
commit bd34a8c158
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -266,7 +266,7 @@ export function createNuxtApp (options: CreateOptions) {
// Expose payload types // Expose payload types
nuxtApp.ssrContext._payloadReducers = {} nuxtApp.ssrContext._payloadReducers = {}
// Expose current path // Expose current path
nuxtApp.payload.path = nuxtApp.ssrContext.event.path nuxtApp.payload.path = nuxtApp.ssrContext.url
} }
// Expose to server renderer to create payload // Expose to server renderer to create payload
nuxtApp.ssrContext = nuxtApp.ssrContext || {} as any nuxtApp.ssrContext = nuxtApp.ssrContext || {} as any

View File

@ -127,7 +127,7 @@ const getSPARenderer = lazyCachedFunction(async () => {
const renderToString = (ssrContext: NuxtSSRContext) => { const renderToString = (ssrContext: NuxtSSRContext) => {
const config = useRuntimeConfig() const config = useRuntimeConfig()
ssrContext!.payload = { ssrContext!.payload = {
path: ssrContext.event.path, path: ssrContext.url,
_errors: {}, _errors: {},
serverRendered: false, serverRendered: false,
data: {}, data: {},