Skip to content

build: pin Node 22 with .nvmrc#1019

Draft
DeepDiver1975 wants to merge 1 commit into
masterfrom
pin-node-22
Draft

build: pin Node 22 with .nvmrc#1019
DeepDiver1975 wants to merge 1 commit into
masterfrom
pin-node-22

Conversation

@DeepDiver1975

Copy link
Copy Markdown
Member

What

Pins Node 22 via .nvmrc and corrects a stale note in CLAUDE.md.

Why

The build requires Node 22 — CI runs it and CLAUDE.md documents it — but nothing pinned the version, so a shell defaulting to an older Node (e.g. 18) fails the gulp build with:

Error [ERR_REQUIRE_ESM]: require() of ES Module .../del/index.js not supported

Several dependencies (del, postcss-custom-properties, …) are ESM-only, and the gulpfile loads them with require(). That only works on Node ≥ 22, which added support for require()-ing ES modules. On older Node the build dies on the first such require.

Changes

  • Add .nvmrc pinning Node 22, so nvm use selects the supported version — matching CI (.github/workflows/ci.yml) and the CLAUDE.md constraint.
  • Fix CLAUDE.md: the old line claimed "the gulpfile handles this with dynamic import()" — it doesn't; it uses require(). Reworded to document that ESM-only deps work because of Node 22's require(ESM) support, and named postcss-custom-properties as another dep that breaks on older Node.

Verification

nvm use && npm run bundle passes on Node 22 and produces build/ui-bundle.zip. (No code change to the build itself — this only pins the toolchain.)

The build requires Node 22 — CI runs it and CLAUDE.md documents it — but
nothing pinned the version locally, so a shell defaulting to an older
Node (e.g. 18) fails the gulp build with ERR_REQUIRE_ESM. Several
dependencies (del, postcss-custom-properties, …) are ESM-only and the
gulpfile loads them via require(), which only works on Node >= 22's
support for require()-ing ES modules.

- add .nvmrc pinning Node 22 so `nvm use` selects the supported version
- correct the CLAUDE.md constraint: it claimed the gulpfile uses dynamic
  import() for ESM-only deps, but it uses require(); document that this
  relies on Node 22 and name the other ESM-only dep that bites on older
  Node

Verified: `nvm use && npm run bundle` passes on Node 22 and produces
build/ui-bundle.zip.

Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@DeepDiver1975 DeepDiver1975 marked this pull request as draft June 15, 2026 15:25
@mmattel

mmattel commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Q: for curiosity, why is this necessary?
I remember that at least before GHA but I am pretty sure also after GHA, we defined to use Node 22.
Was there a change that reverted back to Node below 22 ?
Because I have not identified one and it would have popped up because of ESM usage ?

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.

2 participants