posva/unplugin-vue-router

TS2742 The inferred type of … cannot be named without a reference to …

awdr74100 opened this issue · 1 comments

repo: https://github.com/awdr74100/unplugin-vue-router-bug-reproduction

截圖 2024-02-22 晚上11 13 41
src/router/index.ts:3:7 - error TS2742: The inferred type of 'router' cannot be named without a reference to '../../node_modules/unplugin-vue-router/dist/router-C96Op3uj.mjs'. This is likely not portable. A type annotation is necessary.

This seems to be a type error, and no error will occur in actual operation.

Thank you for your immediate help every time!

As a workaround add import { type _RouterTyped } from 'unplugin-vue-router/types' to the top of the file.
I need to figure out what's wrong with the current version with /types and /runtime...