Repository navigation
Upgrade to Node 24 (minimal) - #470
Merged
Merged
Conversation
Problem: On Node 22+, `yarn build` fails with `Can't resolve 'src/autoPlayMode'`, and cloudflare-worker tests fail with `Cannot set property navigator of #<Object> which has only a getter`. Vercel no longer builds with Node 20. Root cause: preact-cli 3.5.0 loads preact.config.js through the archived `esm` package, which throws on Node 22+; preact-cli catches the error and builds with its default config, dropping the `src/` path alias. Node 21+ defines a getter-only global `navigator`, so `Object.assign` cannot install the service-worker-mock globals. Solution: Patch preact-cli to load the config with `require` (applied by a v4 postinstall through the existing patch-package) and export the config with `module.exports`. Delete the global `navigator` before assigning the mocks. Set `engines.node` to 24.x so Vercel builds with Node 24. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
johnemau
marked this pull request as ready for review
October 8, 2026 18:49
There was a problem hiding this comment.
🟡 Changes recommended
CI and local tooling still select Node 18 or 20, leaving the declared Node 24 runtime untested.
1 open finding
What changed in this PR
Adds minimal Node 24 compatibility while retaining the existing Preact CLI build.
Changes:
- Patches Preact CLI’s incompatible ESM loader and converts its config to CommonJS.
- Handles Node 21+’s getter-only
navigatorin worker tests. - Declares Node 24 as the required runtime.
| File | Description |
|---|---|
package.json |
Declares Node 24 support. |
packages/donate-button-v4/package.json |
Applies the Preact CLI patch after installation. |
packages/donate-button-v4/preact.config.js |
Exports configuration as CommonJS. |
packages/donate-button-v4/patches/preact-cli+3.5.0.patch |
Replaces Preact CLI’s ESM loader with require. |
packages/cloudflare-worker/test/_setup.ts |
Removes Node’s getter-only navigator before mock setup. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Exploding
approved these changes
Oct 8, 2026
CI installed Node 18.17.1 and .tool-versions selected Node 20.11.0, so neither exercised the Node 24 runtime declared in engines.node, where the esm config failure and the getter-only navigator occur. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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.

Fixes
Can't resolve 'src/autoPlayMode'.Cannot set property navigator of #<Object> which has only a getter.Node.js Version "20.x" is discontinued and must be upgraded.Follow-up
🤖 Generated with Claude Code