Report this

What is the reason for this report?

React app deployment fails on digitalocean app platform.

Posted on November 25, 2023

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.



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!

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.

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.