#Lavavel 12, React Site not Display what I expect

3 messages · Page 1 of 1 (latest)

ivory inlet
#

Hello,

I am trying to get a Larvel, React app live on CPanel server. I believe I have checked the basics;

✅ Symlink to from root/public to public_html
✅ .htacces is in place
✅ Run the following… php artisan cache:table, php artisan migrate, php artisan cache:clear
✅ Connected MySql in .env and other env variables

I can see the site loads, but its just a black screen, which is not what I am expecting.

Console shows…
client:1 Failed to load resource: net::ERR_CONNECTION_REFUSED
app.tsx Failed to load resource: net::ERR_CONNECTION_REFUSED
NewOrder.tsx Failed to load resource: net::ERR_CONNECTION_REFUSED
Failed to load resource: net::ERR_CONNECTION_REFUSED

Which suggest something is wrong on the React side of things?

Help would be appreciated

tepid onyx
#

because you uploaded public/.hot accidentally?

weak isle
#

Symlink to from root/public to public_html
.htacces is in place
This does somewhat sound like an incorrect setup. You shouldn't have to rename the public folder, instead you'd need to configure your web server to point to the public folder of your app as its document_root. Same with the htaccess file, Laravel ships with one that's correct for Laravel apps, so no need for a new one or modifications really.

Other than that, as Frankie mentions, ideally you'd want to run npm run build on the server, or on a CI/CD pipeline. Not copy a project from your local filesystem to the server, but have some sort of script that would deploy the app; clone the repo, install the composer dependencies, build your assets etc