Bug
heroku local throws a parse error on comment lines in Procfiles, which foreman has always supported.
Error: line 1 parse error: # -t is timeout, -c is concurrency
Procfile
web: bundle exec puma -C config/puma.rb
# -t is timeout, -c is concurrency
worker: bundle exec sidekiq -t 25 -q critical -q default
Cause
In src/lib/local/load-foreman-procfile.ts, the parser throws on any line containing a word character that doesn't match ^\s*\w+:. Comment lines (starting with #) contain word characters but don't match
that pattern.
const lines = content.split(/\r?\n/).filter((line, i) => {
if (line.match(/\w/)) {
if (!line.match(/^\s*\w+:/)) {
throw new Error('line ' + (i + 1) + ' parse error: ' + line)
}
}
return line.match(/\w/)
})
Suggested fix
Skip comment lines before the validation check:
const lines = content.split(/\r?\n/).filter((line, i) => {
if (line.match(/^\s*#/)) return false
if (line.match(/\w/)) {
if (!line.match(/^\s*\w+:/)) {
throw new Error('line ' + (i + 1) + ' parse error: ' + line)
}
}
return line.match(/\w/)
})
Expected behavior
Comment lines starting with # should be ignored, consistent with the original foreman behavior and the Procfile format.
If this was intentional, it should be listed in the changelog as Procfiles that worked before will now raise an error.
Bug
heroku localthrows a parse error on comment lines in Procfiles, which foreman has always supported.Error: line 1 parse error: # -t is timeout, -c is concurrency
Procfile
Cause
In
src/lib/local/load-foreman-procfile.ts, the parser throws on any line containing a word character that doesn't match^\s*\w+:. Comment lines (starting with#) contain word characters but don't matchthat pattern.
Suggested fix
Skip comment lines before the validation check:
Expected behavior
Comment lines starting with # should be ignored, consistent with the original foreman behavior and the Procfile format.
If this was intentional, it should be listed in the changelog as Procfiles that worked before will now raise an error.