Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
awdr74100 opened this issue Feb 22, 2024 · 1 comment
Closed
Labels
🐞 bug this isn't working as expected 🔹 typescript issue related to types

Comments

@awdr74100
Copy link

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!

@posva posva added 🐞 bug this isn't working as expected 🔹 typescript issue related to types labels Feb 22, 2024
@posva
Copy link
Owner

posva commented Feb 22, 2024

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug this isn't working as expected 🔹 typescript issue related to types
Projects
None yet
Development

No branches or pull requests

2 participants