language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

Error: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.

Open indus opened this issue 3 months ago • 5 comments

Versions 2.0.0 and up give me the error: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. in .vue files (in a vanilla vite project).

Version 1.8.27 does not show an error.

indus avatar Mar 14 '24 09:03 indus

Are you using jsx?

so1ve avatar Mar 14 '24 10:03 so1ve

No not at all. I'm using the default settings from vite creating a vue page with ts set as language in the script block:

<script setup lang="ts">

indus avatar Mar 14 '24 10:03 indus

我发现typescript版本如果在5.1.6 就不会报这个错误。之后的版本都会报这个错误。

longjiahui avatar Mar 27 '24 10:03 longjiahui

https://github.com/vuejs/language-tools/issues/3856 this solved my problem add "jsxImportSource": "vue" in tsconfig.json !

longjiahui avatar Mar 28 '24 01:03 longjiahui

If you don't use jsx typescript should not report this issue 🤔

so1ve avatar Mar 28 '24 01:03 so1ve