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

JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists #732

Closed
theramenboy opened this issue Nov 24, 2021 · 5 comments
Labels
question Further information is requested

Comments

@theramenboy
Copy link

theramenboy commented Nov 24, 2021

Hello, I have a problem after the update of Volar at 21/11/2021, 12:46:47

I have a Vue2@2.6.12 project (no cli) with

  • Webpack@4.44.1
  • vue-property-decorator@9.0.0
  • pug@3.0.2 / pug-loader@2.4.0

image

All the SFC files has this error but webpack still work.
Last week didn't have the problem

Thanks in advance and for the awesome tool :)

@theramenboy
Copy link
Author

Update: the problem seems to appear only to Vue2 SFC. In a new Vite + Vue3 project the issue is not present.
Kind Regards

@estebangmt
Copy link

For me rolling back to 29.5 fixed the issue for now.

@rchl
Copy link
Collaborator

rchl commented Nov 28, 2021

Did you follow the "Setup for Vue 2" instructions at https://github.com/johnsoncodehk/volar/tree/master/extensions/vscode-vue-language-features#using ?

For me this error shows up only when those steps are not performed.

@maninak
Copy link

maninak commented Nov 28, 2021

I use vetur with nuxt (nuxt2 and vue3 syntax via @nuxtjs/composition-api).

As suggested by @rchl (thank you!), I RTFMd and these steps fixed it for me:

  1. update package.json as follows:
     // package.json
     {
       "devDependencies": {
         "@vue/runtime-dom": "latest"
       }
     }
    
  2. yarn install (so that the lockfile is rebuilt with the new dynamic entry "latest")
  3. update tsconfig.json as follows;
    // tsconfig.json{
      "compilerOptions": {
        ...
      },
      "vueCompilerOptions": {
        "experimentalCompatMode": 2, // delete after migrating to vue3 (or nuxt3)
        "experimentalTemplateCompilerOptions": {
          "compatConfig": { "MODE": 2 } // delete after migrating to vue3 (or nuxt3)
        }
      }
    }
  4. reload vscode

I wish vetur could detect this error and hint at me that I need to follow these steps, without having to google around. 🙏

@theramenboy
Copy link
Author

Thanks everyone for your comments.

I tried a couple of things and what fixed the issue for me is following the "Setup for Vue 2" instructions and basically install the "@vue/runtime-dom" and added to the tsconfig.json (Thanks @rchl)

After that the only issue I get is a "JSX element type '__VLS_9' does not have any construct or call signatures.ts(2604)" on a "hgroup" tag that it is basically deprecated so I think it is ok

Thanks again I am closing the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants