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

props typings regression in v3.5.0-alpha.1 #10842

Closed
cexbrayat opened this issue Apr 30, 2024 · 1 comment
Closed

props typings regression in v3.5.0-alpha.1 #10842

cexbrayat opened this issue Apr 30, 2024 · 1 comment

Comments

@cexbrayat
Copy link
Member

cexbrayat commented Apr 30, 2024

Vue version

3.5.0-alpha.1

Link to minimal reproduction

https://play.vuejs.org/#eNqNkk1PGzEQhv+K5QsXYpdCe4jSirbKoZUKCDhaQtbukBj8Jc/sEinKf2d2N4QNX+Jmzzvv+H1mdy1/5azaBuRUzrAqLpNAoCb/NNGFnAqJtZiXksp/QLQLEBtxW1IQBy3ApLXe1ZbgwMSZHtzs4wtByJ4Fvgkx2/NHG+CHkdkiPqRSGykqz2cuQdfGd82umR6NkIdyyDIJNqs7TJHTrrvRZiugkVPRV7raKfPoGlpKyePEZtepRi6JMk61rurIQ2rwri0qAumYg37Dc/g0b4z6iVHj9tMTdfRVfde1Q9oTFGBgq5HdIxsTNwxJWKV46xYvEKsUsvNQzjO5FPdRrffp4V9fo9LALnK1hOr+jfodrgaCiwIIpWWenUa2LIAGeX51Bis+78SQ6sZv6d8RLwGTb7qMQ9vvJtYce9TXp/3bfzEXF9c4XxFEfILqgvbb6Pt57Q38+QAdqbiKrre/yWvUZ5xjdTLa8k0LpXuTF3ysvqkvE+vz0qojuXkE5l0Fxw==

Steps to reproduce

Using a component from an external library like vee-validate throws compilation errors with strictTemplates enabled, as the props type is always inferred to be never.

This may be an issue with vue-tsc or vee-validate itself, but it's only happening with Vue v3.5.

<script setup>
import { ErrorMessage } from 'vee-validate'
</script>

<template>
  <ErrorMessage name="password" class="error" />
</template>

What is expected?

Should compile.

What is actually happening?

Throws with:

error TS2345: Argument of type '{ name: string; class: string; }' is not assignable to parameter of type 'never'.

21       <ErrorMessage name="password" class="error" />

System Info

System:
    OS: macOS 14.4.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 2.02 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.20.1 - ~/.volta/tools/image/node/18.20.1/bin/node
    Yarn: 1.22.17 - ~/.volta/tools/image/yarn/1.22.17/bin/yarn
    npm: 9.7.1 - ~/.volta/tools/image/npm/9.7.1/bin/npm
    pnpm: 9.0.6 - ~/.volta/bin/pnpm
  Browsers:
    Chrome: 124.0.6367.91
    Safari: 17.4.1
  npmPackages:
    vue: 3.5.0-alpha.1 => 3.5.0-alpha.1

Any additional comments?

This does not happen with v3.4 (as you can see in the playground repro)

@yyx990803
Copy link
Member

closed via c146186

@github-actions github-actions bot locked and limited conversation to collaborators May 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants