build: pin Node 22 with .nvmrc#1019
Draft
DeepDiver1975 wants to merge 1 commit into
Draft
Conversation
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>
Contributor
|
Q: for curiosity, why is this necessary? |
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.
What
Pins Node 22 via
.nvmrcand corrects a stale note inCLAUDE.md.Why
The build requires Node 22 — CI runs it and
CLAUDE.mddocuments it — but nothing pinned the version, so a shell defaulting to an older Node (e.g. 18) fails the gulp build with:Several dependencies (
del,postcss-custom-properties, …) are ESM-only, and the gulpfile loads them withrequire(). That only works on Node ≥ 22, which added support forrequire()-ing ES modules. On older Node the build dies on the first suchrequire.Changes
.nvmrcpinning Node22, sonvm useselects the supported version — matching CI (.github/workflows/ci.yml) and theCLAUDE.mdconstraint.CLAUDE.md: the old line claimed "the gulpfile handles this with dynamicimport()" — it doesn't; it usesrequire(). Reworded to document that ESM-only deps work because of Node 22'srequire(ESM)support, and namedpostcss-custom-propertiesas another dep that breaks on older Node.Verification
nvm use && npm run bundlepasses on Node 22 and producesbuild/ui-bundle.zip. (No code change to the build itself — this only pins the toolchain.)