Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

webguy23's avatar

Sail doesn't serve some assets but php serve works fine

I have a Laravel 10 app with some assets in public directory. When I run php serve everything works as expected, all images and JS files are loaded. But when I run sail up, website works but most of the images and JS files from the same public/img and public/js directories aren't loaded.

For example, /img/logo.svg is loaded but /img/map.png is not. In Chrome > Network it shows "Failed to load response data. No data found for resource with with given identifier".

Any ideas on why is this happening and how can I fix this?

0 likes
4 replies
webguy23's avatar

@hupp it has nothing to do with NPM. I'm talking about loading images and JS files through a browser.

For example, 127.0.0.1/img/logo.svg works but 127.0.0.1/img/map.png doesn't work. I have way more files. Like 10 of them work but 25 do not.

hupp's avatar

@webguy23 Kindly share some more details like which Urls(post full url) work and not work. and also share the modifications you have done. Also Run the php artisan storage:link or sail artisan storage:link (Not sure but should try this too)

webguy23's avatar

@hupp I've posted URLs before, these are local URLs like 127.0.0.1/img/logo.svg. I haven't done any modifications, all the URLs work with php artisan serve locally. I did php artisan storage:link before but this command just sets a link between storage/public and public dirs and all my images and JS files are in public already.

Please or to participate in this conversation.