Asset files are not loading after a fresh Laravel Sail installation on MacOS
See original GitHub issue- Laravel Vite Plugin Version: 0.2.4
- Laravel Version: 9.19.0
- Node Version: 16.15.1
- NPM Version: 8.12.1
Description:
After a fresh installation of Laravel Sail and Laravel Breeze, css and js files are not loading in the browser
Steps To Reproduce:
curl -s "https://laravel.build/example-app" | bash
cd example-app
./vendor/bin/sail up
sail composer require laravel/breeze
sail artisan breeze:install
sail npm install && sail npm run dev
vite v2.9.13 dev server running at:
Local: http://localhost:5173/ Network: http://192.168.48.4:5173/
When I visit localhost/login, the console shows “Failed to load resource: bad URL” and these are the locations where the browser is looking for the resources:
http://0.0.0.0:5173/resources/css/app.css http://0.0.0.0:5173/@vite/client http://0.0.0.0:5173/resources/js/app.js
This is how the login page looks like
Issue Analytics
- State:
- Created a year ago
- Comments:25 (5 by maintainers)
Top Results From Across the Web
Laravel Sail - Laravel - The PHP Framework For Web Artisans
After Sail has been installed, you may run the sail:install Artisan command. This command will publish Sail's docker-compose.yml file to the root of...
Read more >Sail fresh installation is not starting and trhows errors when ...
Description: After run sail up it starts to build the containers but stops with the error below: PS! I already created another sail...
Read more >New Sail + Vite Project `sail npm run dev` Does Not Compile ...
Problem: New Laravel Sail + Vite project compiles assets when executing terminal command sail npm run build , but does not compile assets...
Read more >A complete guide to Laravel Sail - osteel's blog
This post is about what to expect from Laravel Sail, how it works and how to make the most of it; it is...
Read more >Laravel storage link won't work on production - Stack Overflow
You're not using a public directory, you're using public_html . I don't like this strategy. Make a public directory in public_html and set...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@AdyGCode Thanks for the reply. I tried all the suggestions:
sail down
andsail up
,Ctr
+C
,sail npm update
, clearing cache from safari and from artisan. Nothing seems to work in my case. As a last resort, I’ll try to get a hold of a different Mac and try to run a fresh install there to see how it goes.Btw, your reply made me think of this immortal line 🤣
@AdyGCode @Fedeorlandau Accessing the Vite dev server directly (http://localhost:3000 or http://localhost:5173, depending on whether you’re running it inside Sail) is expected to return a blank screen at the moment as that’s just where Vite serves assets for HMR. This has been improved with #57 as we’ll now be outputting a default help screen to instruct users to run a dev server for Laravel.