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

oncebar's avatar

Deploying Laravel And React with Vite Project

Hi devlopersπŸ‘‹ My laravel-react-vite project work in localhost But not work on shared hosting. How can i fix this error please.

Errors in Console : GET http : // 127.0.0.1:5173/@vite/client net::ERR_CONNECTION_REFUSED GET http : // 127.0.0.1:5173/resources/js/app.jsx net::ERR_CONNECTION_REFUSED GET http : // 127.0.0.1:5173/@react-refresh net::ERR_CONNECTION_REFUSED

0 likes
25 replies
Sinnbeck's avatar

Do you have a hot file in the public directory? Delete it

2 likes
oncebar's avatar

I deleted it and got this message: Vite manifest not found at: /home/montbygc/test.*************.shop/public/build/manifest.json

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

@oncebar That means you didnt add your build assets

npm run build

And then put the files in /public/buiid on the server (or run the command on the server)

oncebar's avatar

you mean run (npm run build) In localhost then the files have been uploaded again ??

Sinnbeck's avatar

@oncebar Either that, or run it on the production server directly (if that is possible)

oncebar's avatar

I run at (npm run build) in localhost and got me this message at the terminal:

Could not resolve entry module (resources/js/EditUser.jsx). error during build: Error: Could not resolve entry module (resources/js/EditUser.jsx). at error (file:///C:/xampp/htdocs/Projects/ReactLaravelVite/node_modules/rollup/dist/es/shared/rollup.js:1858:30) at ModuleLoader.loadEntryModule (file:///C:/xampp/htdocs/Projects/ReactLaravelVite/node_modules/rollup/dist/es/shared/rollup.js:22369:20) at async Promise.all (index 2)

Sinnbeck's avatar

@oncebar I asked if you could show your app.jsx? Not sure how that would change whether it works :)

Sinnbeck's avatar

@oncebar What? What doesnt work? I am asking you to share the contents of you app.jsx file on this page..

oncebar's avatar

resurces -- css -- views -- js -- -- bootstrap.js -- -- Allusers.jsx -- -- Newuser.jsx

tis is my react content

Sinnbeck's avatar

@oncebar Not sure what I can use that information for. If you dont want to share the content of your files, I cannot help.

The error is clear. You are using resources/js/EditUser.jsx somewhere, and that file does not exist.

oncebar's avatar

yes this file i was deleted it before. (resources/js/EditUser.jsx)

Sinnbeck's avatar

@oncebar But you are still referencing it somewhere in your code. If that place, and delete the reference.

oncebar's avatar

thank you so much Tried a new project and work well Thank youπŸ’šπŸ’šπŸ’šπŸ’šπŸ’šπŸ’šπŸ’šπŸ’šπŸ’šπŸ’šπŸ’šπŸ’šπŸ’šπŸ’šπŸ’šπŸ’šπŸ’šπŸ’šπŸ’šπŸ’šπŸ’š

oncebar's avatar

no problem this project will deleted

oncebar's avatar

Tried a new project and it worked fine thank you But the pictures still depend on this link (http : //127.0.0.1:8000) I get this error in console:

Mixed Content: The page at 'https : //mydomain . com/' was loaded over HTTPS, but requested an insecure element 'http : //127.0.0.1:8000/image/user/gZHI9.png'. This request was automatically upgraded to HTTPS, For more information see https : //blog.chromium . org/2019/10/no-more-mixed-messages-about-https.html

Sinnbeck's avatar

@oncebar Sounds like you have somehow compiled your local url into your code? Is ASSET_URL set in local or production?

oncebar's avatar

i add this code to .env file ,

APP_URL=https : //mydomain . com/ ASSET_URL=https : //mydomain . com/

but not working

Sinnbeck's avatar

@oncebar Does that mean it is fixed? Did you remember to rebuild assets? Maybe you are setting the url somewhere in your code?

oncebar's avatar

@Sinnbeck Now it's working fine Changed the link from the build asset file thank you.

Please or to participate in this conversation.