mars / create-react-app-buildpack

⚛️ Heroku Buildpack for create-react-app: static hosting for React.js web apps
MIT License
3.28k stars 653 forks source link

App not compatible with buildpack - React #165

Closed zhnedyalkow closed 5 years ago

zhnedyalkow commented 5 years ago

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 5 years ago

Closing duplicate. See https://github.com/mars/create-react-app-buildpack/issues/75#issuecomment-551100370

Hadeel-Salah commented 4 years ago

So, what was the solution for this?

mars commented 4 years ago

@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.