Skip to content

ref<HTMLCanvasElement> invokes "Provide a language" #58

@rowild

Description

@rowild

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()" 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 ...), but to no avail. Chatting with Chatgpt, Qwen, Kimi 2 was interesting, but didn't bring up any results.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions