Skip to content

refactor(workspace): friendlier eval error for invalid node module version - #1088

Merged
c-vigo merged 3 commits into
release/1.2.0from
feature/1080-node-version-eval-error
Jul 14, 2026
Merged

c-vigo merged 3 commits into
release/1.2.0from
feature/1080-node-version-eval-error

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Implements #1080 (review follow-up from #1068).

A non-integer version in the node capability module ({ name = "node"; version = ...; }) is now rejected by a builtins.isInt guard before the nodejs_${toString version} interpolation, throwing the module-scoped message node module: invalid Node version of type '<type>' (the 'version' option must be an integer major, e.g. 22) — consistent with the existing unknown-key and unavailable-major throws — instead of Nix's generic "cannot coerce to string".

Review note: the RED test exposed that a string major ("22") was previously silently accepted by coercion; the guard now enforces the documented int contract for that case too (tightening, covered by the parametrized test).

TDD: RED (string silently accepted, attrset → generic coerce error) → GREEN (3 passed incl. the existing unknown-option test); version = 22 regression-probed as still evaluating. Full just precommit green (nixfmt, sync-manifest). Changelog under ## [1.2.0] - TBD ### Changed, root + mirror.

Refs: #1080

@c-vigo
c-vigo merged commit 1ace035 into release/1.2.0 Jul 14, 2026
15 checks passed
@c-vigo
c-vigo deleted the feature/1080-node-version-eval-error branch July 14, 2026 18:10
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.

1 participant