Skip to content
Latchkey

Vue "vue-tsc" Type Error - Fix in CI

vue-tsc type-checks SFC scripts and templates. The dev server transpiles without type checking, so errors only appear when vue-tsc runs in CI.

What this error means

The typecheck step fails with a TSxxxx error inside a .vue file, often a prop or template binding type mismatch.

vue
src/components/User.vue:12:20 - error TS2322: Type 'string' is not
assignable to type 'number'.

12   <UserCard :age="user.name" />
                    ~~~

Common causes

Type checking only runs in CI

Local dev skips type checking, so a mismatch sits unnoticed until vue-tsc runs.

Prop/binding type mismatch

A template binds a value whose type does not match the declared prop.

How to fix it

Fix the type at the binding

  1. Pass a value of the declared type, or correct the prop type.
User.vue
<UserCard :age="user.age" />

Run vue-tsc locally

  1. Add a typecheck script and run it before pushing.
Terminal
vue-tsc --noEmit

How to prevent it

  • Run vue-tsc --noEmit locally and in a pre-push hook.
  • Type component props explicitly so mismatches are caught.

Frequently asked questions

What causes "vue-tsc error"?
Local dev skips type checking, so a mismatch sits unnoticed until vue-tsc runs.
How do I fix vue-tsc error?
Fix the type at the binding

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card