Support custom payload for no-ssr pages
Author: pi0Created Sep 15, 2022Updated Sep 24, 2026
Labelsdiscussion
Ref: https://github.com/nuxt/framework/pull/7535
When server-side rendering is disabled (via header, ssr: false or nuxt generate for index.html, 200.html, and 404.html) Nuxt renders an empty payload to the page. This is almost for any static-generated website unless we are using Nitro plugins to inject a custom payload state.
There are two steps:
- Update SPARenderer to actually use
ssrContext.payloadinstead of returning an empty one - Detect and enable payload extraction if nitro plugins add something to
payload.dataorpayload.state(need to discuss. what are actual uses cases and potential issues with nuxt built-in behavior for hydration)
Source: nuxt/nuxt