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

Error on aria attribute with modeResolution: node #1871

Closed
rchl opened this issue Sep 14, 2022 · 0 comments
Closed

Error on aria attribute with modeResolution: node #1871

rchl opened this issue Sep 14, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@rchl
Copy link
Collaborator

rchl commented Sep 14, 2022

Volar: 0.40.13
Typescript: 4.8.3

Getting a weird error on an aria-live attribute with certain tsconfig.json settings (seems to be mostly specific to moduleResolution !== 'classic'.

Reproduction

bug/aria-live branch: https://github.com/rchl/volar-vue2-test/tree/bug/aria-live

Page:

<template>
    <div aria-live="polite"></div>
</template>

<script>
export default {
    name: 'Index',
}
</script>

tsconfig.json:

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ES2022",
    "moduleResolution": "node",
    "allowJs": true,
    "checkJs": true,
    "sourceMap": false,
    "strict": true,
    "noEmit": true,
    "jsx": "preserve",
    // ...
  },
  "vueCompilerOptions": {
    "strictTemplates": true,
    "target": 2.7,
  }
}

Error:

    2:10  error   Type '{ ariaLive: string; }' is not assignable to type 'ElementAttrs<HTMLAttributes>'. ​ts:2322
                    Property 'ariaLive' does not exist on type 'ElementAttrs<HTMLAttributes>'. Did you mean ''aria-live''?

Screenshot 2022-09-14 at 23 56 11

Additional notes:

Also note how the error diagnostic is shorter than the attribute name. Seems that this is because internally Volar sees it as ariaLive rather than aria-live.
This also manifest when hovering the aria-live attribute -- the highlight is shorter than its name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants