Template refs fail to compile with typescript
Version
3.2.22
Reproduction link
Steps to reproduce
tsconfig
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"moduleResolution": "node",
"allowJs": true,
"sourceMap": true,
"noImplicitAny": false
},
"include": ["Assets/**/*.ts", "Assets/**/*.js", "Assets/**/*.vue"],
"exclude": ["node_modules"]
}
What is expected?
Compiling
What is actually happening?
Throws a compile error for mismatched types
semantic error TS2322: Type 'object | null' is not assignable to type 'HTMLElement | undefined'.
Type 'null' is not assignable to type 'HTMLElement | undefined'.
If you remove the empty div in the template, it will compile without problems.
If you have a compile error, please provide a reproduction that actually demonstrates this.
the SFC playground doesn't work for this type of reproduction, obviously.
Here is a minimal repo: https://github.com/JSteitz/bug_vue_next_template_refs