# Flash an error toast in Vue

> The kit's toast reads flash.toast. An error uses the same array with type error. with() does not reach it.

- URL: https://laravel-vuejs.space/inertia-flash-error-vue
- Author: Anass Ez-zouaine (https://laravel-vuejs.space/author/anass-ez-zouaine)
- Published: 2026-10-11
- Topics: Laravel, VueJs, Inertia

People searching “Inertia flash error” put the sentence in `with('error')` and the toast stays quiet. The [flash guide](https://laravel-vuejs.space/laravel-vue-flash) shows the success shape the Vue starter kit already listens for. An error is the same array.

> **TL;DR**
>
> -   The kit’s toast reads flash.toast.
> -   An error uses the same array with type error.
> -   with() does not reach it.
> -   Do not flash the exception message.
>
> **Who it's for:** Laravel + Vue developers on Inertia
>
> **Applies to:** Laravel 13 · Inertia 3 · Vue 3

## The fix

```php
use Inertia\Inertia;

Inertia::flash('toast', [
    'type' => 'error',
    'message' => 'Could not publish that post.',
]);

return back();
```

`type` is `success`, `info`, `warning`, or `error`. The kit’s `initializeFlashToast()` reads `flash.toast`. A string on another key never arrives.

Use this for a failure that is not a validation error. A bad title still belongs in `form.errors.title` from `validate()`. A toast and a field error for the same mistake makes the user read it twice.

## What to avoid

> **Gotcha**
>
> Do not flash the exception message. It can include SQL or a path. Write a sentence you would say to the person using the page.

## FAQ

**Q: How do I flash an error toast in Vue?**

The kit's toast reads flash.toast. An error uses the same array with type error. with() does not reach it.

**Q: What goes wrong with Inertia flash error?**

Many developers put the sentence in `with('error')` and the toast stays quiet. Do not flash the exception message.
