mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-16 13:48:13 +00:00
fix(nuxt): ensure we add prerender hints to correct event (#23799)
This commit is contained in:
parent
5a6dfd8847
commit
8c9333a41c
@ -114,7 +114,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
if (import.meta.server && import.meta.prerender) {
|
if (import.meta.server && import.meta.prerender) {
|
||||||
// Hint to Nitro to prerender the island component
|
// Hint to Nitro to prerender the island component
|
||||||
appendResponseHeader(event, 'x-nitro-prerender', url)
|
nuxtApp.runWithContext(() => prerenderRoutes(url))
|
||||||
}
|
}
|
||||||
// TODO: Validate response
|
// TODO: Validate response
|
||||||
// $fetch handles the app.baseURL in dev
|
// $fetch handles the app.baseURL in dev
|
||||||
@ -127,7 +127,7 @@ export default defineComponent({
|
|||||||
if (import.meta.server && import.meta.prerender) {
|
if (import.meta.server && import.meta.prerender) {
|
||||||
const hints = r.headers.get('x-nitro-prerender')
|
const hints = r.headers.get('x-nitro-prerender')
|
||||||
if (hints) {
|
if (hints) {
|
||||||
prerenderRoutes(hints)
|
appendResponseHeader(event, 'x-nitro-prerender', hints)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setPayload(key, result)
|
setPayload(key, result)
|
||||||
|
@ -12,10 +12,8 @@ export default defineUntypedSchema({
|
|||||||
* Value should be either a string or array of strings pointing to source directories or config path relative to current config.
|
* Value should be either a string or array of strings pointing to source directories or config path relative to current config.
|
||||||
*
|
*
|
||||||
* You can use `github:`, `gh:` `gitlab:` or `bitbucket:`.
|
* You can use `github:`, `gh:` `gitlab:` or `bitbucket:`.
|
||||||
*
|
|
||||||
* @see https://github.com/unjs/c12#extending-config-layer-from-remote-sources
|
* @see https://github.com/unjs/c12#extending-config-layer-from-remote-sources
|
||||||
* @see https://github.com/unjs/giget
|
* @see https://github.com/unjs/giget
|
||||||
*
|
|
||||||
* @type {(string|string|[string, typeof import('c12').SourceOptions?])[]}
|
* @type {(string|string|[string, typeof import('c12').SourceOptions?])[]}
|
||||||
*/
|
*/
|
||||||
extends: null,
|
extends: null,
|
||||||
|
Loading…
Reference in New Issue
Block a user