Pin the Heroku build's NodeJS version to what the app requires - #674
Merged
Conversation
tricknotes
force-pushed
the
heroku-generator-node-engines
branch
from
September 7, 2026 12:21
3c49549 to
bd634c5
Compare
tricknotes
marked this pull request as ready for review
September 7, 2026 12:24
The `package.json` generated for Heroku carried only `cacheDirectories`. Heroku's NodeJS buildpack reads that file — the project root's, not the Ember application's — to decide which NodeJS to build with, and falls back to the current LTS release when it names no `engines.node`. The requirement belongs to the Ember application: the `ember-cli >= 6.8` blueprint needs NodeJS `>= 20.19.0`, and nothing carried that up to the file Heroku actually consults, so `rake ember:compile` could run on a NodeJS the application rejects. Read `engines.node` from each configured application and write the one they agree on. Applications that disagree are reported and left unpinned rather than resolved: one build serves all of them, and picking a single answer would pin the build to a version the others reject. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014rAfkAVGVifbaEoTVeT66u
tricknotes
force-pushed
the
heroku-generator-node-engines
branch
from
September 7, 2026 12:29
bd634c5 to
b582714
Compare
This was referenced Sep 7, 2026
Merged
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.
Follow-up to #670, which documented this requirement. This makes the generator satisfy it.
Why
The
package.jsongenerated for Heroku carried onlycacheDirectories. Heroku's NodeJS buildpack reads that file — the project root's, not the Ember application's — to decide which NodeJS to build with, and falls back to the current LTS release when it names noengines.node.The requirement belongs to the Ember application: the
ember-cli >= 6.8blueprint needs NodeJS>= 20.19.0(ember-new-outputv7.0.0). Nothing carried that up to the file Heroku actually consults, sorake ember:compilecould run on a NodeJS the application rejects.What changed
EmberCli::PathSet#package_json— the Ember application'spackage.json.EmberCli::App#node_engine— itsengines.node, ornilwhen the file is missing or unreadable. The callers ask in order to describe the application to a build host, and a project without a readablepackage.jsonis still deployable, so it answersnilrather than raising.HerokuGeneratorreadsengines.nodefrom each configured application and writes the one they agree on into the generatedpackage.json.Applications that disagree are reported through
say_statusand left unpinned rather than resolved: one build serves all of them, and picking a single answer would pin the build to a version the others reject.Verification
The one failure is
EmberCli::App#test exits with exit status of 0, which fails onmainin this container too —ember testreportsLauncher Chrome not found, unrelated to this change.New coverage:
App#node_engine— declared, absentengines, missing file, malformed JSON.engineskey — applications agreeing, none declaring, applications disagreeing.Also confirmed end-to-end against the installed dummy application:
EmberCli["my-app"].node_enginereturns">= 20.19.0".Rebased onto #673
This branch was rebased after #673 merged. Besides the
CHANGELOG.mdconflict, the generator spec'sinstance_double(EmberCli::App, …)still stubbedyarn_enabled?, which #673 removed — three examples failed until it was updated toyarn?. Git could not see that one.🤖 Generated with Claude Code
https://claude.ai/code/session_014rAfkAVGVifbaEoTVeT66u