mars/create-react-app-buildpack

App not compatible with buildpack - React

zhnedyalkow opened this issue · 3 comments

Hi @mars,

I have received following error during the deploy:

Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 1.08 KiB | 1.08 MiB/s, done.
Total 3 (delta 0), reused 3 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/mars/create-react-app.tgz
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to e-commerce-crawn.
remote:
To https://git.heroku.com/e-commerce-crawn.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/e-commerce-crawn.git'
zhitomir@zhitomir-HP-ProBook-4530s:/Desktop/Junior to Senior/React course/React-Andrei-course/e-commerce$ ls
node_modules package.json package-lock.json public react.txt README.md src
zhitomir@zhitomir-HP-ProBook-4530s:/Desktop/Junior to Senior/React course/React-Andrei-course/e-commerce$ cd src
zhitomir@zhitomir-HP-ProBook-4530s:~/Desktop/Junior to Senior/React course/React-Andrei-course/e-commerce/src$ git push heroku master
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 1.08 KiB | 1.08 MiB/s, done.
Total 3 (delta 0), reused 3 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/mars/create-react-app.tgz
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to e-commerce-crawn.
remote:
To https://git.heroku.com/e-commerce-crawn.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/e-commerce-crawn.git'

The command is executed in following directory which contains:
node_modules package.json package-lock.json public react.txt README.md src

git push heroku master

git remote -v -->
heroku https://git.heroku.com/e-commerce-crawn.git (fetch)
heroku https://git.heroku.com/e-commerce-crawn.git (push)
origin git@github.com:zhnedyalkow/e-commerce.git (fetch)
origin git@github.com:zhnedyalkow/e-commerce.git (push)

Tried:
heroku buildpacks:clear
heroku buildpacks:set mars/create-react-app

And removed yarn.lock:

git rm yarn.lock
git commit . -m 'Remove Yarn'

Thank you in advance!

mars commented

Closing duplicate. See #75 (comment)

So, what was the solution for this?

mars commented

@hadeelsala7 the solution is: check the build logs for which buildpack is raising the “App not compatible” error. Then, figure out why your app does not meet the requirements of the buildpack.

For create-react-app-buildpack, it is simply looking for package.json. The main reason I’ve observed folks encountering this, is because they put the React app in a sub directory. For Heroku buildpacks, the app must be at the top level of the repo, not nested inside another directory.