Laravel: InvalidArgumentException: Unable to locate a class or view for component [alert].
A <x-alert /> Blade tag has no matching class or anonymous component view.
Unable to locate a class or view for component [alert]InvalidArgumentException: Unable to locate a class or view for componentUnable to locate a class or view for component [x-forms.input]Blade component not found Laravel<x-alert> component not found Meaning
Anonymous components live in resources/views/components/alert.blade.php; class components in app/View/Components/Alert.php with a view. Sub-folders use dots (<x-forms.input />). Check names, case, and for packages that the service provider registers components.
Common causes
- Missing
resources/views/components/alert.blade.php - Wrong sub-folder/dot notation
- Case mismatch on Linux
- Package component not registered/published
- Cached views stale
⚡ Quick fix
- Create
resources/views/components/alert.blade.phpor the class - Use dot notation for folders
php artisan view:clear
Detailed fix by platform
Laravel
php artisan make:component Alert(class + view) orphp artisan make:component Alert --view(anonymous)
How to diagnose
- File — Component view exists?
- Name — Dots for folders?
- Package — Published?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- 403 This action is unauthorized Laravel: Illuminate\Auth\Access\AuthorizationException: This action is unauthorized.
- Attempt to read property "x" on null Laravel/PHP 8: ErrorException: Attempt to read property "name" on null
- Command "x" is not defined Laravel: Symfony\Component\Console\Exception\CommandNotFoundException: Command "make:livewire" is not defined. Did you mean one of these?
Most viewed in Laravel
- MassAssignmentException Laravel: Illuminate\Database\Eloquent\MassAssignmentException: Add [x] to fillable property to allow mass assignment
- The GET method is not supported for route Laravel: The GET method is not supported for route x. Supported methods: POST (MethodNotAllowedHttpException)
- Route [login] not defined Laravel: Symfony\Component\Routing\Exception\RouteNotFoundException: Route [login] not defined
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 4 Nov 2026