fix: parse Procfile process types containing dashes in heroku local - #3883
Merged
Conversation
michaelmalave
approved these changes
Aug 21, 2026
michaelmalave
left a comment
Contributor
There was a problem hiding this comment.
Nice addition. LGTM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
heroku localfails to parse a Procfile when a process type name contains a dash (e.g.worker-primary), throwingline N parse error: .... This worked in v10.17.0 and regressed in v11.1.1 when the Procfile parser was rewritten.The line-validation regex in
parseProcfileused\w([A-Za-z0-9_]) for the process-type name, which excludes dashes. For a line likeworker-primary: ...,\w+matched onlyworker, then expected:but hit-, so the line was treated as malformed and rejected.The fix broadens the character class to
[\w-], i.e.[A-Za-z0-9_-]. This restores the exact character set the previous parser allowed (src/lib/local/foreman/procfile.cjsused[A-Za-z0-9_-]+) and matches Heroku's documented Procfile process-type format. Underscores were already accepted via\w; dashes are the missing piece. Genuinely malformed lines (no colon, invalid characters) are still rejected.Fixes #3653.
Type of Change
Patch Updates (patch semver update)
Testing
Notes:
No setup required. The change is in the Procfile parser used by
heroku local.Steps:
Procfilecontaining a process type with a dash, e.g.:heroku local(orheroku local:run).line 2 parse error: worker-primary: ....npx mocha "test/unit/lib/local/load-foreman-procfile.unit.test.ts"— includes a new regression test covering dashes and underscores; all pass.Related Issues
GitHub issue: #3653