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:
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