I received this message when i deploy to heroku:
remote: =====! create-react-app-buildpack has reached end-of-life 🌅
remote: This build may succeed, but the buildpack is no longer maintained.
remote: On the Heroku-22 stack and beyond, this may fail to build at all.
remote:
remote: Please consider migrating to https://nextjs.org or https://remix.run to develop React apps which are deployable using Heroku's Node.js buildpack https://github.com/heroku/heroku-buildpack-nodejs, or you may develop your own create-react-app deployment with Node.js and Nginx buildpacks.
I’m using this buildpack:
https://github.com/mars/create-react-app-buildpack
But heroku will no longer support it. I don’t know how to migrate my reactapp to nextjs or remix, anyone know an alternative buildpack that supports the newer version of heroku?
3
Answers
Old Answer
The buildpack you’re using is deprecated and doesn’t work on Heroku-22. The simple solution, which is what I’ve done, is to postpone upgrading the Heroku stack until a new buildpack for Create-React-App is released. Heroku-18 is deprecated though, so you should upgrade to Heroku-20.
Updated answer (as of 2023-01-05)
If you have a static website without environment variables, you can use an express server to run the static pre-build assets. Instructions based on this Medium article.
npm install express
(oryarn add express
)scripts/heroku-start.js
with the following content:Procfile
with the following content:I seem to have found a easy work around that is currently working on my site.
I was getting the same error:
remote: =====> Detected Framework: Static HTML
remote: Stack heroku-22 is not supported!
remote: ! Push rejected, failed to compile React.js (create-react-app) multi app.
Although i already had the same page running on Heroku with different text/images (which is somehow running my react page without any buildpack currently).
To fix the issue this is what i tried and it allowed me to git push my app.
When you are pushing your react app from npm make sure to remove the react buildpack from the Heroku settings page for that app, repush via NPM and it should load without any issues and your app is now uploaded to Heroku. Now if you go and reapply your buildpack (https://buildpack-registry.s3.amazonaws.com/buildpacks/mars/create-react-app.tgz) and refresh your page it should be working fine.
FYI the new buildpack by the same commiter is now update and working..
https://github.com/heroku/heroku-buildpack-nodejs – Please review and plug this into the heroku :0
thank you internet NERDS – Love you all
Zero