mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +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 () {
|
||||
const key = `${props.name}:${hashId.value}`
|
||||
const key = `${props.name}_${hashId.value}`
|
||||
if (nuxtApp.payload.data[key]) { return nuxtApp.payload.data[key] }
|
||||
|
||||
const url = `/__nuxt_island/${key}`
|
||||
|
@ -145,7 +145,7 @@ const getSPARenderer = lazyCachedFunction(async () => {
|
||||
async function getIslandContext (event: H3Event): Promise<NuxtIslandContext> {
|
||||
// TODO: Strict validation for url
|
||||
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
|
||||
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) {
|
||||
ISLAND_CACHE!.set(`/__nuxt_island/${islandContext!.name}:${islandContext!.id}`, response)
|
||||
ISLAND_CACHE!.set(`/__nuxt_island/${islandContext!.name}_${islandContext!.id}`, response)
|
||||
}
|
||||
return response
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user