1 year ago
#331105
Rafael
problems deploying my create-react-app application on a cloud hosting
I'm trying to deploy my app on Heroku. I chose Heroku and I'm using the free stuff, I don't know if it has something to do with it, I could have chosen another one. For example, I tried to deploy it on DigitalOcean, and it never ended, so I canceled it after 1 1/2 hours
It seems to be a memory limit problem
If I execute "npm run start" or "npm run build" on my machine, everything works perfectly
EDIT
After searching the internet I found a way to fix the memory limit.
It was adding a new variable to Heroku: NODE_OPTIONS variable, value: --max_old_space_size=1024
But the problem wasn't fixed
Now, the build log is this:
-----> Building on the Heroku-20 stack
-----> Using buildpack: heroku/nodejs
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): 16.13.0
engines.npm (package.json): 8.5.4
Resolving node version 16.13.0...
Downloading and installing node 16.13.0...
Bootstrapping npm 8.5.4 (replacing 8.1.0)...
npm 8.5.4 installed
-----> Restoring cache
- node_modules
-----> Installing dependencies
Installing node modules
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: serenity-sc@0.1.0
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR! react@"^17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.14.0" from react-dom@16.14.0
npm ERR! node_modules/react-dom
npm ERR! react-dom@"^16.13.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /tmp/npmcache.GYeHW/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.GYeHW/_logs/2022-03-24T16_42_31_990Z-debug-0.log
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
As you can see, the problem has to do with the react version or something like that
Can you tell me how to fix this problem?
The git hub is https://github.com/rafaelsoteldosilva/serenity-sc
In the project, I use: create-react-app, react-three-fiber, styled-components
Thanks in advance
Rafael
node.js
heroku
deployment
dev-to-production
build-dependencies
0 Answers
Your Answer