Previous Heroku user here. I'm forced to try other deployment options due to Heroku removing their Free Tier a few months back. I've deployed a few MERN stack applications to Heroku in the past, but I'm having trouble figuring out how to deploy to render.com. Currently I have my app I'm trying to deploy (here) working perfectly in my local environment, but fails when I try deploying to Render as a Web Service. This is the log I get when trying to deploy:
Jan 18 07:20:13 PM ==> Cloning from https://github.com/tgoandrex/wheres-waldo...
Jan 18 07:20:14 PM ==> Checking out commit 3ccd89a93398215a5b71d9b3bd65ac89f461fc15 in branch main
Jan 18 07:20:20 PM ==> Running build command 'npm build'...
Jan 18 07:20:21 PM ==> Generating container image from build. This may take a few minutes...
Jan 18 07:21:42 PM ==> Uploading build...
Jan 18 07:22:11 PM ==> Build uploaded in 22s
Jan 18 07:22:12 PM ==> Build successful
Jan 18 07:22:12 PM ==> Deploying...
After "Deploying..." it just stays there forever and above that it just says "Failed" with no further information. I cannot find any good documents on MERN stack deployment for Render. Is there a way of making this work or should I try another free option elsewhere that provides better support for MERN stacks?
Settings on Render:
Build Command: npm build
Start Command: npm start
package.json:
{
"name": "wheres_waldo",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"body-parser": "^1.20.1",
"concurrently": "^7.6.0",
"cors": "^2.8.5",
"express": "^4.18.2",
"mongodb": "^4.13.0",
"mongoose": "^6.8.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.4.2",
"react-scripts": "^5.0.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "concurrently \"react-scripts start\" \"cd server && node server.js\"",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"dotenv": "^16.0.3"
}
}