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

Dave97's avatar

Laravel5.4 CSS and JS not working in production on Forge server

I created a bitbucket project working properly locally on Xampp server and on MySQL Forge Digital Ocean server. For performance reason, i wanted to to switch to MariaDb so I deleted my droplet through Forge and created a new one on which I uploaded my bucket.

Since then the new website has no CSS or JS display. By SSH I can check all folders are one server and public folder has all necessary files (migrations were done, composer run during deployment and npm run prod was done locally before adding to bucket)

I tried SSHing and running npm run prod directly on server, I got :

npm run production sh: 1: cross-env: not found npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! @ production: cross-env   
NODE_ENV=production

So i run npm install

Then, now npm run prod compiles on server successfully but still no css and js on website. By browsing with Google network, i can see message :

<link media="all" type="text/css" rel="stylesheet" href="https://mywebsite.com/assets/app/css/app.css?id=38e61ac8f53095475ce9">
: Failed to load resources,net ::err connection refused
``` 


0 likes
1 reply
Dave97's avatar
Dave97
OP
Best Answer
Level 1

Through Chrome Network tab, i realised that

  {{ Html::style(mix('/assets/app/css/app.css')) }}

cause a call in https to my assets while on this new website, i had not yet put back the SSL certificate.

A simple call as

<link rel="stylesheet" href="/assets/app/css/app.css">

or putting my website is https solved the issue.

But is this normal than ' Html::style(mix' call in https systematically?

Please or to participate in this conversation.