Resolve ember-cli version from its installed package.json (fixes crash with pnpm catalogs)#1526
Open
NullVoxPopuli wants to merge 1 commit into
Conversation
NullVoxPopuli
force-pushed
the
fix/resolve-ember-cli-version-from-package-json
branch
2 times, most recently
from
July 16, 2026 20:55
f931cfe to
345e7cd
Compare
The `exam` command read the ember-cli version out of the consuming app's
package.json dependency range (`this.project.pkg.devDependencies['ember-cli']`).
That value is not guaranteed to be a concrete semver string: pnpm catalog
(`catalog:`) and workspace (`workspace:`) protocol aliases are left verbatim in
package.json.
When such an alias was present, `validateLoadBalance` passed it to
`semver.validRange`, got `null` back, and then `semver.gtr('3.2.0', null)`
threw `TypeError: Cannot read properties of null (reading 'trim')` — an opaque
crash that took down every `ember exam --load-balance` run.
Read the resolved version from ember-cli's own installed package.json instead,
which always carries a real version regardless of how the app declares the
dependency.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
NullVoxPopuli
force-pushed
the
fix/resolve-ember-cli-version-from-package-json
branch
from
July 16, 2026 20:56
345e7cd to
23d76f6
Compare
Contributor
Author
|
beta/canary/release are expected to fail for now, because they test app for them needs updating |
There was a problem hiding this comment.
Pull request overview
Updates ember exam to derive the Ember CLI version from the installed ember-cli/package.json instead of the host app’s declared dependency range, avoiding semver crashes when the dependency is expressed via pnpm catalogs (catalog:) / workspace:-style specifiers.
Changes:
- Resolve
emberCliVersionfromrequire('ember-cli/package.json').versionduring command initialization. - Add a regression unit test ensuring the resolved version is used even when the declared dependency is a
catalog:alias.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| node-tests/unit/commands/exam-test.js | Adds a regression test covering pnpm catalog-style dependency specifiers. |
| lib/commands/exam.js | Switches emberCliVersion sourcing to the installed ember-cli package’s version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+41
to
+45
| const command = createCommand(); | ||
| command.project.pkg.devDependencies['ember-cli'] = | ||
| 'catalog:ember-ecosystem'; | ||
| command.init(); | ||
|
|
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.
Note
made with claude, and reviewed by me. apologies in advance if I got any of the project's conventions wrong -- happy to adjust.
ember exam --load-balancecrashes in any repo using pnpm catalogs, with a cryptic:we read the ember-cli version out of the app's declared dependency range:
but with catalogs (and
workspace:) that's left verbatim as"catalog:ember-ecosystem"on disk -- pnpm only resolves the alias in the lockfile. sosemver.validRange(...)returnsnull, andvalidateLoadBalance'ssemver.gtr('3.2.0', null)blows up onnew Range(null).fix: read the version from ember-cli's own (installed, always-resolved)
package.jsoninstead. bonus: it's the version actually in use, not just what's declared.added a regression test.
pnpm test:nodegreen, lint clean.