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

ollie_123's avatar

HELP...Vite Production Issue - CSS Not Loading

Hi All

I've got an issue where on my local server the app works perfectly no issues, yesterday in production the app wored fine, i then made a change to the CSS and ran npm run build and transferred to the live server however now on the live server i'm getting an error of.

GET http://127....../resources/css/app.css net::ERR_FAILED

I tried removing the css i added, re running the build etc but still no joy.

In the head it calls the css stylesheet like href="http://127...../resources/css/app.css" and have the same error for all my css files but in another app on the same server it its all working fine and calls the css in the head like href="https://appname/build/assets/app.2e3cf5d6.css".

Completely baffled on this one. if anyone could advise where i've gone wrong it would be much appreciated.

0 likes
10 replies
ollie_123's avatar

Hey @sinnbeck, thanks for the quick response. I didn't have ASSET_URL in my env file but added it and still no change :(.

I've also tried clearing all cache but no joy also

Sinnbeck's avatar

@ollie_123 So you added it and set it to the base url of the production website, and ran npm run build and uploaded again?

ollie_123's avatar

Hi @sinnbeck ah i didnt re run the build...

i've added it to env and re ran npm run build on production server and now get:- npm ERR! Failed at the @ build script.. but i can run build locally ok lol

The thing i'm confused about is its been working fine for months with vite and without the ASSET_URL in env so i don't understand why it now isnt working

Sinnbeck's avatar

@ollie_123 I cannot say where it's getting the 127.0.0.1 from on production if it's not from env. I don't have it set myself and build on production just fine. Also I don't know why it has resources in the url

But I'm confused. First you said you build locally and transfer to production, but now you build on production?

ollie_123's avatar

@sinnbeck yeah its very strange lol.

Normally and in the past i build locally then transfer to live and all is good. It was only when i added the asset_url in the env i thought i would try building on the production server as my local asset_url ends in .app and the production url ends in .co.uk so thought it might throw it off.

I might try removing the whole app from the server and re uploading :/ lol

ollie_123's avatar

THanks @sinnbeck & @shaungbhone, still not sure what caused it but i removed the public & resources file from the server & re uploaded them and it seems to have solved it.

Really appreciate your help & the quick responses to this. Thank you.

1 like

Please or to participate in this conversation.