Skip to content

Duplicate client/server component exports #32539

@dulnan

Description

@dulnan

Environment

------------------------------
- Operating System: Linux
- Node Version:     v20.19.2
- Nuxt Version:     3.17.5
- CLI Version:      3.25.1
- Nitro Version:    2.11.13
- Package Manager:  npm@10.7.0
- Builder:          -
- User Config:      typescript
- Runtime Modules:  -
- Build Modules:    -
------------------------------

Reproduction

This can be reproduced in any Nuxt app. After generating the types in .nuxt, check .nuxt/components.d.ts.

Describe the bug

The NuxtRouteAnnouncer property is defined twice in interface _GlobalComponents and is also exported twice as export const NuxtRouteAnnouncer:

'NuxtRouteAnnouncer': typeof import("../../node_modules/nuxt/dist/app/components/nuxt-route-announcer")['default']
'NuxtRouteAnnouncer': IslandComponent<typeof import("../../node_modules/nuxt/dist/app/components/server-placeholder")['default']>

I noticed it myself when using addComponent twice in a module to add separate client/server versions of the same component, with different mode values.

Another thing I'm also not sure about: In both my addComponent calls I set island: false; however the generated type in components.d.ts for the mode: 'server' version of the component still wraps the component in IslandComponent<>, which I would expect not to happen.

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions