Skip to content

Adding a new script to registry breaks type definitions of #nuxt-scripts/types module #570

@igorexa34314

Description

@igorexa34314

🐛 The bug

  1. Open the reproduction and wait until the nuxt preparation phase is completed.
  2. Try to import something from #nuxt-scripts/types (e.g. RegistryScriptInput type)

You will see the module #nuxt-scripts/types no longer exports these elements

🛠️ To reproduce

https://stackblitz.com/edit/nuxt-starter-8q4kpymg?file=modules%2Fmy-analytics%2Fruntime%2Fcomposables%2Fscript.ts

🌈 Expected behavior

Module #nuxt-scripts/types preserves all type definitions after adding a new script to registry

ℹ️ Additional context

If you open the .nuxt/module/nuxt-scripts.d.ts you can see the export {} at the end of file has been removed as soon as augmentations was applied to module. I think that might be a issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions