fix(nuxt): prefix server component ids to avoid collisions (#21472)

This commit is contained in:
Julien Huang 2023-06-08 22:55:21 +02:00 committed by GitHub
parent 32c8e3bf27
commit ed5732196d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,7 @@ const SLOT_FALLBACK_RE = /<div nuxt-slot-fallback-start="([^"]*)"[^>]*><\/div>((
const SSR_UID_RE = /nuxt-ssr-component-uid="([^"]*)"/
let id = 0
const getId = process.client ? () => (id++).toString() : randomUUID
const getId = process.client ? () => 's' + (id--) : randomUUID
export const createServerComponent = (name: string) => {
return defineComponent({