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

Property 'xx' does not exist on type 'ElementAttrs' #12620

Closed
linjhon opened this issue Jul 6, 2022 · 2 comments
Closed

Property 'xx' does not exist on type 'ElementAttrs' #12620

linjhon opened this issue Jul 6, 2022 · 2 comments

Comments

@linjhon
Copy link

linjhon commented Jul 6, 2022

Version

2.7.3

Reproduction link

github.com

Steps to reproduce

  1. clone reproduction repo
  2. pnpm install
  3. npm run typecheck

What is expected?

Don't show error

What is actually happening?

  1. src/components/icons/IconTooling.vue:5:5
 <svg
  xmlns="http://www.w3.org/2000/svg"
  xmlns:xlink="http://www.w3.org/1999/xlink"
 >
  //...
 </svg>
error TS2322: Type '{ xmlns: string; "xmlns:xlink": string; ariaHidden: string; "aria-hidden": "true"; role: string; class: string; width: string; height: string; preserveAspectRatio: string; viewBox: string; }' is not assignable to type 'ElementAttrs<SVGAttributes>'.
  Property 'xmlns:xlink' does not exist on type 'ElementAttrs<SVGAttributes>'.
  1. src/App.vue:14:9
<img
  alt="Vue logo"
  class="logo"
  src="@/assets/logo.svg"
  width="125"
  height="125"
  aria-disabled="true"
/>
error TS2322: Type '{ alt: string; class: string; src: string; width: string; height: string; ariaDisabled: string; "aria-disabled": "true"; }' is not assignable to type 'ElementAttrs<ImgHTMLAttributes>'.
  Property 'ariaDisabled' does not exist on type 'ElementAttrs<ImgHTMLAttributes>'. Did you mean ''aria-disabled''?
@yyx990803
Copy link
Member

/cc @johnsoncodehk

The JSX type should be consistent with v3 - does this only happen when using vue-tsc with Vue 2?

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Jul 8, 2022

This problem is fixed by vuejs/language-tools#1533 and released with Volar v0.38.3, please update your Volar extension version in VSCode.

@linjhon linjhon closed this as completed Jul 11, 2022
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

3 participants