Skip to content
This repository was archived by the owner on Jun 11, 2022. It is now read-only.
This repository was archived by the owner on Jun 11, 2022. It is now read-only.

Output a clearer error message for detect failures #186

@edmorley

Description

@edmorley

Currently if bin/detect for this buildpack fails to find a package.json, the build outputs shows:

$ mkdir -p testapp-cra && cd $_ && git init && h create
$ h buildpacks:add mars/create-react-app
$ touch foo
$ git add -A && git commit -m '.' && git push heroku main
...
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

If bin/detect were to instead output a package.json not found in app source type error message to stderr (must be stderr or the build system ignores it), then that would be shown in the output instead.

Examples of what other buildpacks output:
https://github.com/heroku/heroku-buildpack-nodejs/blob/master/bin/detect
https://github.com/heroku/heroku-buildpack-php/blob/main/bin/detect

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions