Skip to content

move vue and vue-router to external#1066

Open
stackoverfloweth wants to merge 2 commits intovuejs:mainfrom
stackoverfloweth:fix/devtools-kit-external-vue-router
Open

move vue and vue-router to external#1066
stackoverfloweth wants to merge 2 commits intovuejs:mainfrom
stackoverfloweth:fix/devtools-kit-external-vue-router

Conversation

@stackoverfloweth
Copy link

Summary

When @vue/devtools-kit bundles its type declarations via tsdown, it inlines the types from vue-router (a devDependency). This causes vue-router's declare module 'vue' augmentations — specifically the GlobalComponents interface with RouterView and RouterLink — to be embedded in dist/index.d.ts.

This creates type conflicts for any library that also augments GlobalComponents with its own RouterView or RouterLink components (e.g. @kitbag/router). TypeScript's declaration merging requires subsequent property declarations to have the same type, so consumers see errors like:

Caution

TS2717: Subsequent property declarations must have the same type. Property 'RouterView' must be of type '...' but here has type '...'

The same inlining also causes Vue's App type to be duplicated as App$1, leading to type mismatches when passing App instances to setupDevtoolsPlugin.

Fix

Add external: ['vue', 'vue-router'] to the tsdown config for @vue/devtools-kit. This prevents tsdown from inlining their type declarations into the bundled .d.ts output, keeping them as external import(...) references instead. Both packages are already devDependencies — their types should not be bundled.

Test plan

  • Build @vue/devtools-kit and verify dist/index.d.ts no longer contains vue-router's GlobalComponents augmentation
  • Verify downstream projects that augment GlobalComponents with their own router components no longer get TS2717 errors

@netlify
Copy link

netlify bot commented Mar 18, 2026

Deploy Preview for vue-devtools-docs canceled.

Name Link
🔨 Latest commit 4cc14c0
🔍 Latest deploy log https://app.netlify.com/projects/vue-devtools-docs/deploys/69baf1dbf5bb7d0007a20bd1

Co-authored-by: skirtle <65301168+skirtles-code@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants