Deploy my 'full stack' app

Hello !

I need some help to deploy my app, I keep trying but it’s not working…

GitHub - brithe00/watzeid - this is my repo github, you can see the scripts I use and the architecture of the folders.

I created a web service (free tier) linking the repo, used this commands :

  • build command: npx prisma generate --schema=server/prisma/schema.prisma && npm install
  • start command: node server/src/index.js
    I added my env variables too.

After this I created a static site linking the same repo and used this commands :

  • build command: npm run render-postbuild
  • publish directory: ./client/build
    I also added env variables.

After this I got differents errors of this type :

I got the Not Found from express (I think it’s from express)
Got this too : ENOENT: no such file or directory, stat ‘/opt/render/project/src/client/build/index.html’
And my api endpoints are not working too, I tried to add some rewrites but it’s not working or do I have to change the endpoints in frontwend with the new onrender generated ?

Thanks for reading this and if you know what is the problem to solve this.

Brian

Hey !

Btw I think the backend is working, i’m interracting with the API with Postman and it seems to work.

I have just this error when I try to interact with a route that does not exist :

ENOENT: no such file or directory, stat ‘/opt/render/project/src/client/build/index.html’

In the frontend the website is working but not the API calls.

Without rewrites I get a 404 error ‘Not Found’

If I add rewrites the 404 error turn for a 500 error and the message is :

ENOENT: no such file or directory, stat ‘/opt/render/project/src/client/build/index.html’

Have you got any ideas ?

Thanks a lot !

Hi,

It depends on how you want to set this up, the error seems to imply you want to have a single Web Service serving the API and React App through Express.

In that case, the “no such file” shows a “client/build” folder as part of the path, this usually implies that the build script hasn’t been run to generate that folder. Your Build Command on a single service setup would need to:

  • install backend dependencies
  • install frontend dependencies
  • run a build script for the frontend
  • any other commands, DB migrations, etc.

If you want to use separate services and have the React app as Static Site, then Express no longer needs to serve the static files. You’ll need to configure the static site to make its client-side requests to the backend URL.

Alan

1 Like

Hey !

Lol I just did what you said and it’s working ! First try !
Like at the end it was so easy lol

Thanks a lot !

Hi @al_ps apologies this is not related to the topic above. Noone has responded to my situation query. Hence this.

Some context about it → i deployed one full stack app , with static and webservice yesterday and after a while,when i visited the url, i was getting -
“The service has been suspended by the. Owner”

And i am also logged out of my account, unable to login n i get redirected to login over n over. My previously deployed service is also down now. All my projects were purely for learning purposes.

For reference, Some of my website links are :

  1. https://netflixapi-v9xz.onrender.com
  2. https://netflix-admin-web-app.onrender.com/login

(continued…)

  1. https://netflixapi-v9xz.onrender.com
  2. https://libvault.onrender.com

These are also mine. Moreover, after few minutes of deploying my project i started getting deceptive site ahead warning on the deployed service from render. I read that render provides SSL certificates and had cloudflare certificate on my site as well. Yet the warning persisted even after i changed my service name to nflix instead of Netflix…

For Any context and action regarding my account, could u please help me understand what caused all of it…

Thanks in advance,

Best regards!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.