fix(plugin-core): declare minimum Node.js version in engines - #328
Closed
jingjing2222 wants to merge 1 commit into
Closed
fix(plugin-core): declare minimum Node.js version in engines#328jingjing2222 wants to merge 1 commit into
jingjing2222 wants to merge 1 commit into
Conversation
jingjing2222
requested review from
gronxb,
heecheolman,
intmain,
l2hyunwoo,
leegeunhyeok and
raon0211
as code owners
July 10, 2026 08:43
🦋 Changeset detectedLatest commit: ecd97e3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 28 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jingjing2222
force-pushed
the
fix/declare-node-engines
branch
from
July 10, 2026 08:47
ecd97e3 to
d0c3691
Compare
jingjing2222
marked this pull request as draft
July 10, 2026 08:48
jingjing2222
marked this pull request as ready for review
July 10, 2026 08:49
Collaborator
Author
|
tsdown makes itself dying |
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
Declares the minimum required Node.js version (
>=22.15.0) in theenginesfield of@granite-js/plugin-core.Problem
Running
granite dev(orbuild) on Node.js < 22.15.0 in a Yarn PnP project crashes at startup with a hard-to-diagnose error:Nothing warns about the Node.js version at install time, so users only hit this at runtime.
Cause
@granite-js/plugin-core's CJS bundle (dist/index.cjs) callsrequire('c12'), and c12 v3 is an ESM-only package, so this goes through Node'srequire(esm)path.--experimental-loader .pnp.loader.mjs).require(esm)module graph is resolved with#cachedDefaultResolve, which bypasses registered customization hooks entirely. c12's ownimport 'pathe'is then resolved against the real filesystem (inside a zip, with nonode_modules) and fails.#cachedResolveSync, which routesrequire(esm)resolution through the registered hooks (implement module.registerHooks() to run synchronous module customization hooks in thread nodejs/node#55698), making it work under Yarn PnP.Verified by bisecting: 22.12.0 / 22.13.0 / 22.14.0 all reproduce the exact error above, and 22.15.0 / 22.15.1 / 22.17.1 / 22.18.0 all work (
granite buildcompletes andgranite devstarts normally on 22.15.0).Note: this floor comes from the ESM-only dependency +
require(esm)+ Yarn PnP combination. It is unrelated to Node 22.18's type stripping —granite.config.tsis loaded via jiti.Effect
This declares the requirement in a machine-readable way. Verified behavior per package manager when installing on Node.js 22.14.0:
EBADENGINEwarnings at install time (covers transitive dependencies too); hard-fails withengine-strict=trueERR_PNPM_UNSUPPORTED_ENGINEwhenengine-strict=trueis set (silent by default)engines(neither the project's own nor dependencies'), so PnP users are not protected at install time — for them the field serves as documentation, and is picked up by deployment platforms, Renovate, and theyarn-plugin-enginespluginSince Yarn PnP users (where the failure actually occurs) get no install-time protection, a runtime Node.js version check in the CLI with a friendly error message would be a good follow-up.