mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-24 22:55:13 +00:00
fix(nuxt): use pascal name when loading server component (#27928)
This commit is contained in:
parent
e1110493e2
commit
ed7a14aecc
@ -58,7 +58,7 @@ export const loaderPlugin = createUnplugin((options: LoaderOptions) => {
|
||||
!components.some(c => c.pascalName === component.pascalName && c.mode === 'client')
|
||||
if (isServerOnly) {
|
||||
imports.add(genImport(serverComponentRuntime, [{ name: 'createServerComponent' }]))
|
||||
imports.add(`const ${identifier} = createServerComponent(${JSON.stringify(name)})`)
|
||||
imports.add(`const ${identifier} = createServerComponent(${JSON.stringify(component.pascalName)})`)
|
||||
if (!options.experimentalComponentIslands) {
|
||||
logger.warn(`Standalone server components (\`${name}\`) are not yet supported without enabling \`experimental.componentIslands\`.`)
|
||||
}
|
||||
|
2
test/fixtures/basic/pages/islands.vue
vendored
2
test/fixtures/basic/pages/islands.vue
vendored
@ -109,7 +109,7 @@ const count = ref(0)
|
||||
</NuxtIsland>
|
||||
</div>
|
||||
</div>
|
||||
<ServerWithClient />
|
||||
<server-with-client />
|
||||
<ServerWithNestedClient />
|
||||
</div>
|
||||
</template>
|
||||
|
Loading…
Reference in New Issue
Block a user