Home > OS >  React.js and Node.js on Heroku
React.js and Node.js on Heroku

Time:06-13

I've created a react app with node.js and stored it on github.

I've tried to deploy it to Heroku, but it has kept giving me an error.
"App not compatible with buildpack:"

My repo folder has two files "api" and "client". Each folder has package.json inside. I feel like the buildpack path should lead package.json file directly.

How can I launch my react website through github?

CodePudding user response:

To launch your React app, you need to deploy your frontend app and backend app separately. Unfortunately, Heroku won't recognize a combined repo with both folders.

An easier way is to create two separate GitHub repos for your api subfolder and client subfolder. Use React buildpack for the frondend app and NodeJS buildpack for the backend app.

Alternative solution is to manually deploy your apps through git subtree push, for which you can refer to this tutorial.

CodePudding user response:

In my case, buildpack should be "heroku/nodejs".

  • Related