← All tasks
javascriptvuejs/router #1456Not a task: not reproduced

vue-router 4.1.x missing types export

envgap__vuejs__router-1456

01 / FAILURE SIGNATURE

As reported upstream

compile error:
Not a benchmark task.
  • In a clean container the reported failure did not reproduce, or the known fix did not make the project run.

02 / ENVIRONMENT RECIPE

Base commit
60c375de3a8af01fca5e391a28dacbf9e1e46d0f
Manifest
packages/router/package.json
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

vuejs/router #1456 · read the original issue
### Version

4.1.1



### Reproduction link

[github.com](https://github.com/microsoft/TypeScript/issues/47792)















### 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';`



---

https://github.com/microsoft/TypeScript/issues/47792 is the tracking issue for this globally for TypeScript.



<!-- generated by vue-issues. DO NOT REMOVE -->
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]