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

ULink & UButton to prop don't use generated type-safe routes #1253

Closed
mlutsiuk opened this issue Jan 18, 2024 · 4 comments
Closed

ULink & UButton to prop don't use generated type-safe routes #1253

mlutsiuk opened this issue Jan 18, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@mlutsiuk
Copy link

Environment

Version

v2.12.2

Reproduction

image image image

Description

NuxtLink uses RouteLocationRaw imported from #vue-router

import type { RouteLocationRaw } from '#vue-router';

Currently src/runtime/utils/link.ts uses RouteLocationRaw imported from vue-router

import type { RouteLocationRaw } from 'vue-router'

Additional context

No response

Logs

No response

@mlutsiuk mlutsiuk added the bug Something isn't working label Jan 18, 2024
Copy link
Member

benjamincanac commented Jan 18, 2024

I was pretty sure that importing from vue-router or #vue-router was the same as vue-router-stub.d.ts looks like:

export * from 'vue-router'

Did you enable the experimental feature? https://nuxt.com/docs/guide/going-further/experimental-features#typedpages

@mlutsiuk
Copy link
Author

Yes, i enabled typedPages

Copy link
Member

benjamincanac commented Jan 18, 2024

Let me know if https://github.com/nuxt/ui/releases/tag/v2.12.3 fixes it for you 😊

@mlutsiuk
Copy link
Author

Sadly, but it's not. I forked and tested it on the playground, and it works perfectly fine.
I checked compiled Button.vue.d.ts, and it missing the new import from #vue-router.

I suppose it was sorted out during the compile time.
Maybe these generated types from .nuxt/ must be resolved in some special way, but i can't find how to do it.

@benjamincanac benjamincanac reopened this Jan 19, 2024
@benjamincanac benjamincanac added the v3 #1289 label Apr 12, 2024 — with Volta.net
@benjamincanac benjamincanac removed the v3 #1289 label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants