Skip to content

chore: upgrade Node.js from 20.19.4 to 22.19.0 and update dependencies#19870

Merged
ThomasK33 merged 1 commit into
mainfrom
thomask33/nix-flake-node-bump
Sep 18, 2025
Merged

chore: upgrade Node.js from 20.19.4 to 22.19.0 and update dependencies#19870
ThomasK33 merged 1 commit into
mainfrom
thomask33/nix-flake-node-bump

Conversation

@ThomasK33
Copy link
Copy Markdown
Member

@ThomasK33 ThomasK33 commented Sep 18, 2025

Update Node.js from 20.19.4 to 22.19.0

This PR updates Node.js from v20.19.4 to v22.19.0 across the codebase. The change includes:

  • Updated Node.js version in GitHub Actions setup-node workflow
  • Updated Node.js version in the dogfood Dockerfile
  • Changed from pkgs.nodejs_20 to unstablePkgs.nodejs_22 in the Nix flake
  • Updated the Node.js engine version constraints in package.json files to allow Node.js 22
  • Updated Playwright from v1.47.0 to v1.50.1
  • Updated tzdata dependency from v1.0.44 to v1.0.46
  • Updated the flake.lock file with latest nixpkgs references

The PR also improves the error message for Playwright version mismatches by showing the actual versions in the error.

@ThomasK33 ThomasK33 changed the title chore: Bump node engine version chore: bump node engine version Sep 18, 2025
@ThomasK33 ThomasK33 force-pushed the thomask33/nix-flake-node-bump branch from f2ec4af to 241294b Compare September 18, 2025 10:31
@aslilac
Copy link
Copy Markdown
Member

aslilac commented Sep 18, 2025

if everything still seems to work on 22 I'd be happy for us to upgrade. we need to upgrade everyone tho. for reference, here's the most recently merged node upgrade:

https://github.com/coder/coder/pull/19188/files

@ThomasK33 ThomasK33 force-pushed the thomask33/nix-flake-node-bump branch 5 times, most recently from 3622f3e to 3e3a767 Compare September 18, 2025 16:57
Copy link
Copy Markdown
Member Author

Thanks, I've overlooked those.
Updated the dogfood Docker image and the setup-node action.

Also, in Node 22, Node’s Intl timezone support is slightly different from tzdata (e.g., “America/Coyhaique” exists in tzdata but is rejected by Intl/dayjs). Hence, the tests started failing on the 22 version.
I've added a filter for tzdata zones, removing all zones that Intl throws on, so that we only use timezones the Node runtime can parse.

Comment thread .github/actions/setup-node/action.yaml Outdated
@aslilac
Copy link
Copy Markdown
Member

aslilac commented Sep 18, 2025

Also, in Node 22, Node’s Intl timezone support is slightly different from tzdata

it's not that, the version you picked just has an older version of the database

v22.14.0/tz-version.txt -> 2024b
v22.19.0/tz-version.txt -> 2025b

@aslilac
Copy link
Copy Markdown
Member

aslilac commented Sep 18, 2025

I'm kind of a nix noob but this shows 22.18, which uses 2025b.

https://search.nixos.org/packages?channel=25.05&show=nodejs_22&query=nodejs_22

@ThomasK33 ThomasK33 force-pushed the thomask33/nix-flake-node-bump branch from 3e3a767 to 4e7f6cb Compare September 18, 2025 20:10
In the nix flake's devshell, we used `nodejs_20` (20.18.3).
`vite@7.1.4` requires a newer node version (^20.19.0).

This commit bumps the flake's node version to `nodejs_22`, and
updates the allowed engine versions in the sites package.json.

```bash
❯ make gen
generate
ok      github.com/coder/coder/v2/coderd/database/gentest       0.649s
ok      github.com/coder/coder/v2/cli   3.258s
ok      github.com/coder/coder/v2/coderd        3.655s
ok      github.com/coder/coder/v2/coderd/notifications  3.322s
ok      github.com/coder/coder/v2/enterprise/cli        2.238s
ok      github.com/coder/coder/v2/enterprise/tailnet    0.741s
ok      github.com/coder/coder/v2/helm/coder/tests      2.891s
ok      github.com/coder/coder/v2/helm/provisioner/tests        1.336s
ok      github.com/coder/coder/v2/provisioner/terraform 0.755s
ok      github.com/coder/coder/v2/tailnet       0.697s
+ pnpm install
Lockfile is up to date, resolution step is skipped
 ERR_PNPM_UNSUPPORTED_ENGINE  Unsupported environment (bad pnpm and/or Node.js version)

Your Node version is incompatible with "vite@7.1.4(@types/node@20.17.16)(jiti@2.4.2)(yaml@2.7.0)".

Expected version: ^20.19.0 || >=22.12.0
Got: v20.18.3

This is happening because the package's manifest has an engines.node field specified.
To fix this issue, install the required Node version.
make: *** [Makefile:416: site/node_modules/.installed] Error 1
```
@ThomasK33 ThomasK33 force-pushed the thomask33/nix-flake-node-bump branch from 4e7f6cb to 96684bf Compare September 18, 2025 20:27
Copy link
Copy Markdown
Member Author

I'm kind of a nix noob but this shows 22.18, which uses 2025b.

https://search.nixos.org/packages?channel=25.05&show=nodejs_22&query=nodejs_22

Kinda. We're still on the 24.11 release channel.
We could update to 25.05, but then we need to update all other tools in the dogfood image.

I've now pulled in the nodejs_22 from the unstable nixpkgs, which is v22.19.0.

Thanks Kayla.

Copy link
Copy Markdown
Member

@aslilac aslilac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code looks perfect! thanks!

might update the pr title before you merge tho, this is a bit more than just bumping the engine field now :)

Comment thread flake.nix
@ThomasK33 ThomasK33 changed the title chore: bump node engine version chore: upgrade Node.js from 20.19.4 to 22.19.0 and update dependencies Sep 18, 2025
@ThomasK33 ThomasK33 merged commit 4d8dc22 into main Sep 18, 2025
36 checks passed
@ThomasK33 ThomasK33 deleted the thomask33/nix-flake-node-bump branch September 18, 2025 21:08
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants