Skip to content

vue-router 4.1.x missing types export #1456

@lizthegrey

Description

@lizthegrey

Version

4.1.1

Reproduction link

github.com

Steps to reproduce

upgrade from vue-router 4.0.16 to vue-router 4.1.1 using Yarn 4 / TypeScript 4.7 in ESM mode

What is expected?

dist/vue-router.d.ts is picked up as the types

What is actually happening?

dist/vue-router.d.ts is not detected as the types, because it is not in the exports fields, only in the top level types field.

compile error:
[tsl] ERROR in /home/lizf/eve-roster/src/client/admin/SwaggerPane.vue.ts(4,26)
TS7016: Could not find a declaration file for module 'vue-router'. '/home/lizf/eve-roster/.yarn/virtual/vue-router-virtual-6bddcd632c/0/cache/vue-router-npm-4.1.1-b947f4f193-a3fe6b4ed4.zip/node_modules/vue-router/index.js' implicitly has an 'any' type.
Try npm i --save-dev @types/vue-router if it exists or add a new declaration (.d.ts) file containing declare module 'vue-router';


microsoft/TypeScript#47792 is the tracking issue for this globally for TypeScript.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtypescriptProblem related to TS typings

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions