By ahmet ali
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!
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:
Hope that this helps!
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.