The Problem
Vite appears to be running, according shell in Terminal, but does not update the page, recognize CSS changes and is not accessible over port 5173 on localhost.
Context
- I am on macOS Sonoma 14.5
- Running Laravel 11
- Running Laravel Sail
- Running
npm run dev
to utilize Vite - Application runs fine without site on http://localhost, even when Vite is running, but does not update.
- Output for Vite in Terminal indicates it’s running and watching files.
- Output for Vite in Safari Console indicates the page cannot access 5173
Shell Output in Terminal
VITE v5.3.1 ready in 106 ms
➜ Local: http://localhost:5173/
➜ Network: http://172.20.0.3:5173/
➜ press h + enter to show help
LARAVEL v11.10.0 plugin v1.0.4
➜ APP_URL: http://localhost
Console Output
[Error] Failed to load resource: Could not connect to the server. (client, line 0)
[Error] Failed to load resource: Could not connect to the server. (app.css, line 0)
[Error] Failed to load resource: Could not connect to the server. (header.js, line 0)
[Error] Failed to load resource: Could not connect to the server. (app.js, line 0)
[Log] Users Data: – [] (0) (localhost, line 164)