mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-16 13:48:13 +00:00
fix(nuxt): replace :
in rendered server components (for win) (#21645)
This commit is contained in:
parent
9df892a17f
commit
3fd6c179e4
@ -69,7 +69,7 @@ export default defineComponent({
|
|||||||
})
|
})
|
||||||
|
|
||||||
async function _fetchComponent () {
|
async function _fetchComponent () {
|
||||||
const key = `${props.name}:${hashId.value}`
|
const key = `${props.name}_${hashId.value}`
|
||||||
if (nuxtApp.payload.data[key]) { return nuxtApp.payload.data[key] }
|
if (nuxtApp.payload.data[key]) { return nuxtApp.payload.data[key] }
|
||||||
|
|
||||||
const url = `/__nuxt_island/${key}`
|
const url = `/__nuxt_island/${key}`
|
||||||
|
@ -145,7 +145,7 @@ const getSPARenderer = lazyCachedFunction(async () => {
|
|||||||
async function getIslandContext (event: H3Event): Promise<NuxtIslandContext> {
|
async function getIslandContext (event: H3Event): Promise<NuxtIslandContext> {
|
||||||
// TODO: Strict validation for url
|
// TODO: Strict validation for url
|
||||||
const url = event.node.req.url?.substring('/__nuxt_island'.length + 1) || ''
|
const url = event.node.req.url?.substring('/__nuxt_island'.length + 1) || ''
|
||||||
const [componentName, hashId] = url.split('?')[0].split(':')
|
const [componentName, hashId] = url.split('?')[0].split('_')
|
||||||
|
|
||||||
// TODO: Validate context
|
// TODO: Validate context
|
||||||
const context = event.node.req.method === 'GET' ? getQuery(event) : await readBody(event)
|
const context = event.node.req.method === 'GET' ? getQuery(event) : await readBody(event)
|
||||||
@ -363,7 +363,7 @@ export default defineRenderHandler(async (event): Promise<Partial<RenderResponse
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (process.env.prerender) {
|
if (process.env.prerender) {
|
||||||
ISLAND_CACHE!.set(`/__nuxt_island/${islandContext!.name}:${islandContext!.id}`, response)
|
ISLAND_CACHE!.set(`/__nuxt_island/${islandContext!.name}_${islandContext!.id}`, response)
|
||||||
}
|
}
|
||||||
return response
|
return response
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user