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

noirtempest's avatar

Laravel Inertia React Js Blank Page in Production

Help! It works really fine in local but on the production I'm getting blank pages

 app.jsx

app blade

0 likes
16 replies
JussiMannisto's avatar
  1. Have you built the production bundles using npm run build?
  2. Check your browser's dev tools console for any error messages.
noirtempest's avatar

@JussiMannisto yes sir I run the build command many times but still getting a blank pages

error getting status 500 in all pages and I compare the route lists local and production its the same

JussiMannisto's avatar

@noirtempest The 500 status code means a server error. Check the backend logs (storage/logs/laravel.log by default).

JussiMannisto's avatar

@noirtempest If there are no logs inside the Laravel storage, it might mean a couple of things.

The web server might not have write permissions to the log files. This could explain why your app isn't working to begin with. The web server is running as some user (e.g. www-data, nginx or apache) and it should own the files of your app. This way it can create session and cache files, write to the sqlite database file etc.

If you have shell access, your can modify the owner by running this command in the root of your project:

sudo chown yourWebServerUser:yourWebServerGroup -R .

Replace yourWebServerUser and yourWebServerGroup with the correct user and group.

Another possibility is that there's something wrong with your server configuration and Laravel fails to even boot up. Check the server logs. If it's your own server, they might be under /var/log/nginx, /var/log/apache2, /var/log/httpd or similar.

JussiMannisto's avatar

@noirtempest Does the web server have write access to the log files?

There's no way that the server throws a 500 error without any logging. If it's not in laravel.log, then it's in the web server's logs.

noirtempest's avatar

@JussiMannisto this is the error on the web server

[proxy_fcgi:error [pid xxxxxxx:tid xxxxxxx [client xxx.xx.xx.xxx:x Premature end of script headers: index.php, referer: https://unified.cloudways.com/
JussiMannisto's avatar

@noirtempest Likely bad file permissions or bad server configuration. I don't know how you're hosting the app so I can't say more.

noirtempest's avatar

@JussiMannisto, I’m not the one who hosted the applications, but after pushing my updates (without installing any new packages), I ran the build and got blank pages. Even after removing my updates, the error persisted.

JussiMannisto's avatar

@noirtempest

I checked permissions folders 775 and files 664

But who owns the files? The app won't work if they belong to the wrong user. 0664 means that only the file owner and group members have write access. Run this command at the root of your project to see the user and group:

stat -c "%U %G" storage/

You should see the web server's username, e.g. www-data, nginx or apache. If you see your own username, that's the issue. Also everything inside storage must be owned by the web server user.

after pushing my updates (without installing any new packages), I ran the build and got blank pages

How did you push the updates?

noirtempest's avatar

@JussiMannisto I just checked the web servers username is correct.... and to answer the question I push via desktop github then pull it from the server then run some commands

gych's avatar

Check if there's a hot file in your public folder and if so delete it.

Please or to participate in this conversation.