Skip to content

Improve bin/detect error messages#575

Merged
jmorrell merged 2 commits into
masterfrom
warn-on-slugignore
Oct 8, 2018
Merged

Improve bin/detect error messages#575
jmorrell merged 2 commits into
masterfrom
warn-on-slugignore

Conversation

@jmorrell
Copy link
Copy Markdown
Contributor

@jmorrell jmorrell commented Oct 3, 2018

Before:

       Node.js: package.json not found in application root

After:

!     ERROR: 'package.json' listed in '.slugignore' file
!
!     The 'heroku/nodejs' buildpack is set on this application, but was
!     unable to detect a 'package.json' file. This is likely because
!     the '.slugignore' file is removing it before the build begins.
!
!     For more information, refer to the following documentation:
!     https://devcenter.heroku.com/articles/slug-compiler#ignoring-files-with-slugignore
!     ERROR: 'package.json' listed in '.gitignore' file
! 
!     The 'heroku/nodejs' buildpack is set on this application, but was
!     unable to detect a 'package.json' file. This is likely because
!     the '.gitignore' file is preventing it from being checked in to
!     the git repo.

!     For more information, refer to the following documentation:
!     https://devcenter.heroku.com/articles/gitignore
 !     ERROR: Application not supported by 'heroku/nodejs' buildpack
 !
 !     The 'heroku/nodejs' buildpack is set on this application, but was
 !     unable to detect a Node.js codebase.
 !
 !     A Node.js app on Heroku requires a 'package.json' at the root of
 !     the directory structure.
 !
 !     If you are trying to deploy a Node.js application, ensure that this
 !     file is present at the top level directory. This directory has the
 !     following files:
 !
 !     LICENSE
 !     README.md
 !     index.js
 !     src/
 !
 !     If you are trying to deploy an application written in another
 !     language, you need to change the list of buildpacks set on your
 !     Heroku app using the 'heroku buildpacks' command.
 !
 !     For more information, refer to the following documentation:
 !     https://devcenter.heroku.com/articles/buildpacks
 !     https://devcenter.heroku.com/articles/nodejs-support#activation

@jmorrell jmorrell requested a review from a team as a code owner October 3, 2018 22:42
@jmorrell jmorrell changed the title Improve bin/detect error message Improve bin/detect error messages Oct 3, 2018
Copy link
Copy Markdown

@CaseyFaist CaseyFaist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love the new messages! Future refactor could be to extract error text and pull in using env vars or cating to separate error detection and documentation, but not necessary for this update. 💯 for tests, too 👍

@jmorrell jmorrell merged commit 545b330 into master Oct 8, 2018
@jmorrell jmorrell deleted the warn-on-slugignore branch January 24, 2019 22:36
sunnymsf pushed a commit to sunnymsf/sfdocs-heroku-buildpack-nodejs that referenced this pull request Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants