question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.ts(7026)

See original GitHub issue

Describe the bug The above error is shown for any ‘native’ html (span, div) tag, but not for Vue components such as template, MyComponent. I have the exact same repo on three machines (Two W10, one Mac) and it only happens on one (W10), so it doesn’t seem to be anything wrong with the config. Nothing has been changed

To Reproduce Difficult to provide exact reproduction because it is only happening on one environment out of three, but minimal repo provided anyway https://github.com/chrissyast/nuxt-typescript/tree/minimal_example

  1. Clone
  2. yarn install
  3. Open pages/index.vue

Expected behavior No errors on <div> tag

Screenshots image

Additional context A lot of the google search results were related to React and suggested it was a types issue https://stackoverflow.com/a/59046713/8940624, but I have added “@nuxt/types” to tsconfig. On both the failing and working PC, tsc --version yielded tsc' is not recognized as an internal or external command,. I installed typescript on the failing PC anyway but still the issue persists

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:9

github_iconTop GitHub Comments

34reactions
jihogrammercommented, Dec 11, 2021

If you are using “volar”, try using “vutur”.

16reactions
FossPrimecommented, Feb 24, 2022

This issue is unrelated to typescript… but, for anyone who stumbles on this issue:

Uninstalling volar is no longer an acceptable answer… vue-tsc will also produce this error. install @vue/runtime-dom and then in a tsconfig.node.json referenced file, experimental mode

Here’s my tsconfig.node.json:

{
  "compilerOptions": {
    "composite": true,
    "module": "esnext",
    "moduleResolution": "node"
  },
  "include": [
    "vite.config.ts"
  ],
  "vueCompilerOptions": {
    "experimentalCompatMode": 2, // delete after migrating to vue3 (or nuxt3)
    "experimentalTemplateCompilerOptions": {
      "compatConfig": {
        "MODE": 2
      } // delete after migrating to vue3 (or nuxt3)
    }
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to solve "JSX element implicitly has type 'any' " error?
I solved this issue by reloading VSCode. Ctrl + Shift + P -or- ⌘ + shift + P. Then type: Developer: Reload Window....
Read more >
JSX element implicitly has type 'any' because no interface ...
To solve the error "JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists", make sure to install the typings for react ......
Read more >
For almost every .tsx file in my project TS7026: JSX element ...
For almost every .tsx file in my project TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. #44418.
Read more >
Kent C. Dodds on Twitter: "Protip: "JSX element implicitly has ...
Protip: "JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.ts(7026)" This likely means you forgot to ...
Read more >
JSX element implicitly has type 'any' because no interface ...
Code Examples. JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.ts(7026); JSX element implicitly has type ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found