Skip to content

fix: add Node.js 24 to CI#13441

Merged
gr2m merged 19 commits intorelease-v5.0from
add-node-24-to-ci-v5
Mar 16, 2026
Merged

fix: add Node.js 24 to CI#13441
gr2m merged 19 commits intorelease-v5.0from
add-node-24-to-ci-v5

Conversation

@gr2m
Copy link
Copy Markdown
Collaborator

@gr2m gr2m commented Mar 15, 2026

Summary

  • Add Node.js 24 to the CI test matrix and root engines field
  • Upgrade vitest from v2/v3 to v4 across all packages for Node 24 compatibility
  • Update SvelteKit example dependencies for Node 24 support
  • Fix @testing-library/jest-dom setup for vitest v4 (move from side-effect imports to explicit expect.extend(matchers) in setup files)
  • Replace Array.at() with bracket access in Angular tests for ES2018 compat
  • Fix File object inline snapshots in elevenlabs/openai tests (Node 24 adds FileState symbol)
  • Fix MCP SSE reconnect test race condition with vi.waitFor
  • Fix gateway test mock to use constructor-style vi.fn for vitest v4
  • Update react-dom devDependency to v19 to match resolved react version

Test plan

  • pnpm type-check:full passes
  • pnpm test passes (91/95 tasks; remaining failures are pre-existing: @ai-sdk/rsc port conflict, @ai-sdk/codemod unrelated assertion)

gr2m and others added 15 commits March 14, 2026 21:53
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…port

@sveltejs/adapter-vercel v5 only supports Node 18/20/22. Upgrade to v6
which adds Node 24 to valid_node_versions. Also upgrade @sveltejs/kit to
v2.55+ as required by adapter v6.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Upgrade vitest to v4 in @ai-sdk/vue and @ai-sdk/mcp (were still on 2.1.4)
- Fix it() timeout option syntax in e2e tests (vitest v4 takes number, not object)
- Fix MCP oauth test to access URL and Headers properties directly
- Update MCP inline snapshot for vitest v4 formatting

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Angular test file used .at(0) and .at(1) which require ES2022 lib,
but the project targets ES2018. This was exposed by the vitest v4 upgrade.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Vitest v4 no longer auto-registers jest-dom matchers via side-effect
imports. Move matcher registration to setup files and remove the
inline imports from test files.
@tigent tigent bot added the maintenance CI, internal documentation, automations, etc label Mar 15, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The jscodeshift/typescript sourcemap infrastructure doesn't work
correctly on Node 24. This is a pre-existing issue unrelated to the
vitest v4 upgrade.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The jscodeshift/typescript sourcemap infrastructure is incompatible
with vitest v4. This is a pre-existing issue in the codemod package.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
gr2m added a commit that referenced this pull request Mar 16, 2026
## Summary

Adds Node.js 24 to the CI test matrix and fixes all build/test
incompatibilities.

Closes #13357

## Changes

### CI & config
- Adds Node.js 24 to `.github/workflows/ci.yml` test matrix
- Adds `^24.0.0` to root `package.json` engines field

### SvelteKit example build fix
- Updates `@sveltejs/adapter-vercel` from v5 to v6 and `@sveltejs/kit`
to v2.55+ in `examples/sveltekit-openai` — adapter-vercel v5 only
supported Node 18/20/22, v6 adds Node 24

### Vitest v2 → v4 upgrade
Node 24 ships with undici v7, which enforces strict `AbortSignal`
instanceof checks in `fetch()`. The jsdom environment in vitest v2/v3
replaces the global `AbortController`/`AbortSignal` with its own
polyfill, and Node 24's native fetch rejects these with `"Expected
signal to be an instance of AbortSignal"`. Vitest v4 stops overriding
these globals
([vitest-dev/vitest#8390](vitest-dev/vitest#8390)),
fixing the incompatibility.

#### Test adaptations required by vitest v4

**`vi.fn()` arrow functions can no longer be used as constructors** —
vitest v4 wraps mock functions differently, so arrow-function mocks fail
with `TypeError: is not a constructor` when called with `new`. Fixed by
changing arrow functions to `function` expressions in mock
implementations:
-
`packages/amazon-bedrock/src/bedrock-event-stream-response-handler.test.ts`
- `packages/baseten/src/baseten-provider.unit.test.ts`
- `packages/gateway/src/gateway-provider.test.ts`
-
`packages/google-vertex/src/google-vertex-auth-google-auth-library.test.ts`

**`toStrictEqual(expect.objectContaining(...))` is stricter** — vitest
v4 now requires that `undefined` properties on the actual object (e.g.
`metadata: undefined`) also appear in the expected pattern. Since these
tests intentionally do partial matching, changed to
`toEqual(expect.objectContaining(...))`:
- `packages/angular/src/lib/chat.ng.test.ts`
- `packages/svelte/src/chat.svelte.test.ts`

**`toThrowError` with an Error object checks all properties** —
previously only checked `message`, now checks every property. The
anthropic overloaded-error test compared `requestBodyValues: {}` against
the full request body. Changed to try/catch with individual property
assertions:
- `packages/anthropic/src/anthropic-messages-language-model.test.ts`

**`test.workspace` renamed to `test.projects`**:
- `packages/svelte/vite.config.ts`

### Other test fixes
- `packages/openai` and `packages/elevenlabs`: Made `File` object
snapshot tests Node version-agnostic (Node 24 serializes additional
`Symbol(state)` on File objects)
- `packages/mcp`: Fixed race condition in SSE reconnect test where
`server.calls[2]` was accessed before the fire-and-forget
`openInboundSse()` completed — added `vi.waitFor()`
- Pinned `tinyexec` to 1.0.2 via pnpm overrides (1.0.3 has broken
package exports on npm)

### Backports 

- v6: #13440
- v5: #13441

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@gr2m gr2m merged commit 98915fb into release-v5.0 Mar 16, 2026
18 checks passed
@gr2m gr2m deleted the add-node-24-to-ci-v5 branch March 16, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance CI, internal documentation, automations, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants