Show a field error with the kit input

The Vue starter kit already has InputError. Pass it the validation string. Do not install a second kit.

For your AI agent

Copies a prompt. Paste it into the AI agent you already have open.

Read https://laravel-vuejs.space/shadcn-vue-input-error.md
The Vue starter kit already has InputError. Pass it the validation string. Do not install a second kit.
Do not install a second kit.
Do not run the shadcn CLI to "add the error component" inside this kit.
Show the diff. Do not commit.
On this page · 3 sections
  1. The fix
  2. What to avoid
  3. FAQ

People searching “shadcn vue input error” install shadcn-vue again on top of the Laravel Vue starter kit. The kit already includes it. The setup guide says so. The string you pass is the same form.errors.email the CRUD guide prints in a paragraph.

TL;DR

  • The Vue starter kit already has InputError.
  • Pass it the validation string.
  • Do not install a second kit.
  • Do not run the shadcn CLI to “add the error component” inside this kit.

Who it's for: Laravel + Vue developers on Inertia

Applies to: Laravel 13 · Inertia 3 · Vue 3

The fix#

The kit’s component takes one message:

vue
<script setup lang="ts">
import { useForm } from "@inertiajs/vue3";
import InputError from "@/components/InputError.vue";

const form = useForm({ email: "" });
</script>

<template>
  <input v-model="form.email" name="email" type="email" />
  <InputError :message="form.errors.email" />
</template>

form.errors.email is a string. It is not an array. Inertia keeps the first message for the key. If your InputError expects message, pass that string. If the import path is missing, the component file is not there yet: use the paragraph from the CRUD guide instead of adding a library.

What to avoid#

Gotcha

Do not run the shadcn CLI to “add the error component” inside this kit. You get a second copy of the primitives and two opinions about the field.

FAQ#

How do I show a field error with the kit input?

The Vue starter kit already has InputError. Pass it the validation string. Do not install a second kit.

What goes wrong with shadcn vue input error?

Many developers install shadcn-vue again on top of the Laravel Vue starter kit. Do not run the shadcn CLI to "add the error component" inside this kit.

Found this useful?

Ask questions, share what you built.

Join thousands of Laravel and Vue developers in our Facebook group, or get new posts in your Telegram feed. Sharing this article helps too.

Keep reading

Newsletter

Get the best of Laravel & Vue, once a month.

One short email with new guides, release notes worth reading and hand-picked community links. No spam, unsubscribe any time.