S A I D U R
Development

If Vite Alpinejs is not working with Laravel, this guide will fix it.

This is a common issue when setting up the frontend in Laravel.

Main Problem

Error:

Failed to resolve import "alpinejs"

Step 1: Install Alpinejs

npm install alpinejs

Step 2: Correct Import

import Alpine from 'alpinejs';

window.Alpine = Alpine;

Alpine.start();

Step 3: Run Dev Server

npm run dev

Step 4: Clear Cache

php artisan optimize:clear

If Vite Alpinejs is not working with Laravel, check:

✔ Installed package
✔ Import path
✔ Dev server

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2026 All rights reserved by Md Saidur Rahman