language-tools: Release 0.40.1 breaks typescript compatibility on script setup

This morning’s release breaks the typescript/tslint’s compatibility on <script lang='ts' setup>.

More specifically the following error is triggered:

'default' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.ts(7022)

As you may see it only happens in <script> and does not extend outside it.

image

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 6
  • Comments: 29 (5 by maintainers)

Most upvoted comments

In my case downgrading to 0.39.5 solved it.

Edit: I have experiencied many issues arround my code after update to 0.40+ (my components, vue imports, etc), after change to 0.39.5 they have been gone.

I experienced the same issue, when having circular references between components.

Here is a minimal reproducible example. (literally just npm init vue@latest with minimal features and only two components)

Steps to reproduce:

  1. Clone Repo
  2. Open src/components/A.vue or src/components/B.vue in VS Code with Volar version 0.40.1
  3. Error

Hope it helps!

@johnsoncodehk @Shinigami92 have this issue as well, am having a hard time reproducing it in a minimal reproduction but I believe its related to circular type imports, or additional typing of .vue imports (allowing circular type references where they didn’t occur before)

Only thing I know for sure is that the issue started with 0.40.0

As for a reproduction, might not be “minimal” but the Factor repo has the issue:

Finally, i think a lot of recent bug reports since 0.40.0 are this same issue

In my case downgrading to 0.39.5 solved it.

Edit: I have experiencied many issues arround my code after update to 0.40+ (my components, vue imports, etc), after change to 0.39.5 they have been gone.

I’ve had several problems, especially with global components since v0.39.5 also.

I have a minimal reproduction: https://github.com/ouuan/volar-1708-reproduce

I find this happens when using recursive components with unplugin-vue-components (the components.d.ts generated by this plugin causes this issue, the plugin itself can be removed in the reproduction).

@Shinigami92 Would

Release 0.40.1 breaks typescript compatibility on script setup.

be a better fit?

https://palantir.github.io/tslint/

image

PLEASE move away from TSLint!!!