Skip to content

Commit 4585eb0

Browse files
committed
fix: use .nuxt rather than .payload on ssrContext
1 parent 2709ffc commit 4585eb0

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/runtime/nitro/renderer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ const getSPARenderer = lazyCachedFunction(async () => {
7878
buildAssetsURL
7979
}
8080
// Create SPA renderer and cache the result for all requests
81-
const renderer = createRenderer(() => () => { }, options)
81+
const renderer = createRenderer(() => () => {}, options)
8282
const result = await renderer.renderToString({})
8383

8484
const renderToString = (ssrContext: NuxtSSRContext) => {
8585
const config = useRuntimeConfig()
86-
ssrContext.payload = {
86+
ssrContext.nuxt = {
8787
serverRendered: false,
8888
config: {
8989
public: config.public,

test/bridge.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ await setup({
1010

1111
describe('pages', () => {
1212
it('render hello world', async () => {
13-
expect(await $fetch('/')).to.contain('Hello Vue 2!')
13+
const html = await $fetch('/')
14+
expect(html).toContain('Hello Vue 2!')
15+
expect(html).toContain('public:{myValue:123}')
1416
await expectNoClientErrors('/')
1517
})
1618
it('uses server Vue build', async () => {
17-
expect(await $fetch('/')).to.contain('Rendered on server: true')
19+
expect(await $fetch('/')).toContain('Rendered on server: true')
1820
})
1921
})
2022

0 commit comments

Comments
 (0)