mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(nuxt): set config on ssrContext
in spa renderer (#20216)
This commit is contained in:
parent
8f67d871b8
commit
fe2800540c
@ -124,13 +124,13 @@ const getSPARenderer = lazyCachedFunction(async () => {
|
||||
ssrContext!.payload = {
|
||||
_errors: {},
|
||||
serverRendered: false,
|
||||
config: {
|
||||
public: config.public,
|
||||
app: config.app
|
||||
},
|
||||
data: {},
|
||||
state: {}
|
||||
}
|
||||
ssrContext.config = {
|
||||
public: config.public,
|
||||
app: config.app
|
||||
}
|
||||
ssrContext!.renderMeta = ssrContext!.renderMeta ?? getStaticRenderedHead
|
||||
return Promise.resolve(result)
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ describe('route rules', () => {
|
||||
const { script, attrs } = parseData(await $fetch('/route-rules/spa'))
|
||||
expect(script.serverRendered).toEqual(false)
|
||||
expect(attrs['data-ssr']).toEqual('false')
|
||||
await expectNoClientErrors('/route-rules/spa')
|
||||
})
|
||||
|
||||
it('test noScript routeRules', async () => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
if (nuxtApp.payload.blinkable !== '<revivified-blink>') {
|
||||
if (nuxtApp.payload.serverRendered && nuxtApp.payload.blinkable !== '<revivified-blink>') {
|
||||
throw createError({
|
||||
message: 'Custom type in Nuxt payload was not revived correctly'
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user