web-accessibility icon indicating copy to clipboard operation
web-accessibility copied to clipboard

ref<HTMLCanvasElement> invokes "Provide a language"

Open rowild opened this issue 6 months ago • 0 comments

Describe the bug In a Nuxt 4 project that uses Typescript, the referencing of HTML elements (no matter which one, Image, Canvas,...) using ref invokes the "Provide a language" warning.

To Reproduce 0. In VS Code, have this extension installed and activated

  1. In a vue file, create a canvas element in the template section
  2. in the script section, use "const canvasRef = ref<HTMLCanvasElement>()" to reference it

Expected behavior No wiggly lines, no warning, no error

Screenshots Image

Visual Studio Code (please complete the following information):

  • Version 1.102.3

Additional context When I deactivate this extension, the wiggly lines are gone.

I am not a Typescript expert, but to my knowledge it is not possible to add attributes to Type Annotations. I also tried to apply Nuxt's config tricks (app.config.ts, using <Head>...), but to no avail. Chatting with Chatgpt, Qwen, Kimi 2 was interesting, but didn't bring up any results.)

rowild avatar Aug 02 '25 19:08 rowild