Skip to content

hotfix(apiSmokeTest): undici 6.21.1 for Node 20 runtime compat#56

Merged
chrisbc merged 1 commit into
mainfrom
hotfix/undici-node20-compat
Jun 10, 2026
Merged

hotfix(apiSmokeTest): undici 6.21.1 for Node 20 runtime compat#56
chrisbc merged 1 commit into
mainfrom
hotfix/undici-node20-compat

Conversation

@chrisbc

@chrisbc chrisbc commented Jun 10, 2026

Copy link
Copy Markdown
Member

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": "8.2.0"
    
  • "undici": "6.21.1"
    
    },
    ```

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

  • ✅ `node --version` → v20.19.2; `node -e "import('./dist/index.js')"` → no module-load error
  • ❌ self-test workflow (loads main's dist; same broken result as the toshi-api deploy)
  • ✅ on merge to main, `nshm-toshi-api/deploy-test` will pick up the fix and the smoketest will succeed end-to-end

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.

…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`.
@chrisbc chrisbc merged commit d1758ae into main Jun 10, 2026
26 of 29 checks passed
@chrisbc chrisbc deleted the hotfix/undici-node20-compat branch June 10, 2026 03:05
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