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

regression with directives and strictTemplates in v1.6 #3140

Closed
cexbrayat opened this issue May 7, 2023 · 4 comments
Closed

regression with directives and strictTemplates in v1.6 #3140

cexbrayat opened this issue May 7, 2023 · 4 comments
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@cexbrayat
Copy link
Member

Using vue-tsc in v1.6.4 with strictTemplates: true throws for a simple directive like:

Focus.ts

import { type Directive } from 'vue';

export const vFocus: Directive<HTMLInputElement> = {
  mounted(el) {
    el.focus();
  }
};

App.vue

<script setup lang="ts">
import { vFocus } from './Focus';
</script>

<template>
  <input v-focus name="name" />
</template>

Error:

src/App.vue:6:10 - error TS2345: Argument of type 'ElementAttrs<InputHTMLAttributes>' is not assignable to parameter of type 'HTMLInputElement'.
  Type 'InputHTMLAttributes & ReservedProps' is missing the following properties from type 'HTMLInputElement': align, defaultChecked, defaultValue, dirName, and 303 more.

6   <input v-focus name="name" />
           ~~~~~~~

Repro https://stackblitz.com/edit/node-witrt2?file=vue-project/tsconfig.app.json

cd vue-project
pnpm i
pnpm type-check
@so1ve so1ve added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first labels Jun 27, 2023
@so1ve
Copy link
Member

so1ve commented Jun 28, 2023

Hi @cexbrayat 👋 Thanks for your reproduction! Could you please check which version introduces this regression? (If you have time)

@mattersj
Copy link

@so1ve I just checked it: exactly 1.6.0. The latest available version on market before that was 1.4.4 and it worked fine.

@so1ve
Copy link
Member

so1ve commented Jun 28, 2023

Thanks, I'll look into this in a few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first
Projects
None yet
Development

No branches or pull requests

3 participants