DEV Community

Discussion on: Deploy Your React App To Heroku

Collapse
 
niinpatel profile image
Nitin Patel

You forgot one important step I beleive.

Before deploying the app go to:
Heroku dashboard > settings > buildpacks > add buildpacks and then add github.com/mars/create-react-app-b...

Or, in command line you can do

heroku buildpacks:set github.com/mars/create-react-app-b...

If you don't do this step, heroku will deploy the development build (which is slow) of your react app instead of the optimized production build.

Collapse
 
sameerkatija profile image
Sameer Katija

Well, ThankYou Nitin. I wasn't able to upload, but your comment worked Thanks buddy, <3

Collapse
 
nobu0605 profile image
Nobu • Edited

I really appreciate you!
 Finally, I deployed my app to Heroku correctly.

Before deploying, I spent almost 5 hours.

Collapse
 
keerthilingu profile image
Keerthilingu

Yes, github.com/mars/create-react-app-b... build pack is required for create-react-app template (static sites).

In Heroku dashboard, under settings> buildpack - I changed from node build pack to github.com/mars/create-react-app-b... and then react static web page started working (or buildpack can be set via Heroku CLI also).

If your app is involving, node backend , then checkout github.com/mars/heroku-cra-node