Question

React app deployment fails on digitalocean app platform.

So i am trying to deploy my MERN app to digitalocean app platform, both backend and frontend(react) part.

the backend part builds and deploys successfully, but the frontend part builds successfully but fails at deployment.

here are the frontend deployment logs:

[2023-11-25 08:02:28] > my-app1@0.1.0 start
[2023-11-25 08:02:28] > export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts start
[2023-11-25 08:02:28] 
[2023-11-25 08:02:33] ℹ 「wds」: Project is running at http://10.244.94.220/
[2023-11-25 08:02:33] ℹ 「wds」: webpack output is served from 
[2023-11-25 08:02:33] ℹ 「wds」: Content not from webpack is served from /workspace/Front-end/public
[2023-11-25 08:02:33] ℹ 「wds」: 404s will fallback to /
[2023-11-25 08:02:33] Starting the development server...
[2023-11-25 08:02:33] 
[2023-11-25 08:02:33] npm notice 
[2023-11-25 08:02:33] npm notice New major version of npm available! 9.6.7 -> 10.2.4
[2023-11-25 08:02:33] npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.2.4>
[2023-11-25 08:02:33] npm notice Run `npm install -g npm@10.2.4` to update!
[2023-11-25 08:02:33] npm notice 

and here’s the link to the code i am trying to deploy: github.com/learnacadman/mern-lms-app

any idea how to solve this? i cant find any.

Thanks.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
November 27, 2023
Accepted Answer

Hi there,

As far as I can see from the output, you are deploying your React app as a web service and running it in development mode:

...
[2023-11-25 08:02:33] Starting the development server...
...

There is no need to deploy your frontend React app as a web service. Instead, you should just deploy it as a static site as this will build your assets and compile them for production.

You can follow the steps on how to deploy a React app as a static site here:

https://www.digitalocean.com/community/tutorials/how-to-deploy-a-react-application-to-digitalocean-app-platform

Hope that this helps!

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel