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

Typescript/typechecking failing on recursive components #14711

Closed
some-user123 opened this issue Aug 25, 2022 · 2 comments
Closed

Typescript/typechecking failing on recursive components #14711

some-user123 opened this issue Aug 25, 2022 · 2 comments

Comments

@some-user123
Copy link

some-user123 commented Aug 25, 2022

Environment


  • Operating System: Linux
  • Node Version: v16.14.2
  • Nuxt Version: 3.0.0-rc.8
  • Package Manager: npm@7.17.0
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/nuxt-starter-md1jod?file=components%2FRecursiveComponent.vue

Describe the bug

A component that uses itself causes error TS7022: 'default' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. when typechecking.

It sometimes works when incrementally writing the SFC and generating types in the background. However, as soon as you delete .nuxt and run nuxi prepare, typechecking will fail.

Additional context

No response

Logs

No response

@danielroe
Copy link
Member

This may be worth raising upstream with https://github.com/johnsoncodehk/volar/tree/master/packages/vue-tsc.

@some-user123
Copy link
Author

Seems like somebody did that already ;-) vuejs/language-tools#1708

It's solved in the latest version of vue-tsc.

@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants