hotfix(apiSmokeTest): undici 6.21.1 for Node 20 runtime compat#56
Merged
Conversation
…compat
The previous resolution pinned undici to 8.2.0. undici 8.x requires
Node 22+ (uses webidl.util.markAsUncloneable, only available on the
runner's bundled Node 22+). The apiSmokeTest action declares
`using: node20`, so on the runner the dist loads on Node 20 and fails
at module-evaluation time with:
TypeError: webidl.util.markAsUncloneable is not a function
at new CacheStorage (.../dist/index.js:...)
This was masked in the self-tests of #55 (they passed) but surfaced
when nshm-toshi-api's deploy-test ran against the merged main.
Pin to undici 6.21.1 — actively maintained, Node 18+ compatible,
matches what the older pre-#55 dist effectively bundled. Verified
locally that the rebuilt dist loads cleanly on Node 20.19.2.
dist/index.js + sourcemap rebuilt via `yarn build`.
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
Hotfix for a regression introduced by #55. The dist rebuilt in that PR bundled undici 8.2.0 (per the existing `resolutions` block), which uses `webidl.util.markAsUncloneable` — only available on Node 22+. The action declares `using: node20`, so at module-evaluation time on the runner it crashes:
```
TypeError: webidl.util.markAsUncloneable is not a function
at new CacheStorage (.../dist/index.js:32096:18)
at requireUndici (.../dist/index.js:...)
```
Surfaces on every consumer:
Change
```diff
"resolutions": {
```
undici 6.x is actively maintained and Node 18+ compatible.
`dist/index.js` + sourcemap rebuilt via `yarn build`.
Self-test caveat
The deploy-to-aws-uv test workflow on this PR fails for the same reason as the post-#55 failure on main: the workflow's `Smoke Test` step does `uses: GNS-Science/.../apiSmokeTest@main`, which resolves to main's broken dist regardless of which branch the test workflow runs from. That's also why #55's self-test passed despite shipping the broken dist — it was running main's pre-merge (good) dist, not the PR's (broken) one.
The same self-reference problem prevents this PR from self-validating. Fix verified locally instead.
Verification
Why was 8.2.0 pinned originally?
Best guess: dependabot suggestion or a CVE bump. If a future undici 7.x+ is needed, the action also needs `using: node24` (currently opt-in, becomes default 2026-06-16).
Suggested follow-up (separate PR)
Switch the deploy workflows' Smoke Test step to use the action via `uses: ./.github/actions/apiSmokeTest` (local path) so self-tests actually validate the action from the PR branch. That would have caught both the #55 regression and made this hotfix self-validating.