engines.node says >= 12.0.0 but node/index.js uses ??= (Node 15) — main entry is a SyntaxError on 12/13/14
The problem
package.json declares
"engines": { "node": ">= 12.0.0" }and the main entry, node/index.js, uses logical assignment (??=) at lines 45 and 51:
res.dependencies ??= [];??= is Node 15.0. On Node 12, 13 or 14 — all of which the manifest says are supported — require('lightningcss') is a SyntaxError, which happens at parse time, so no version check inside the file can guard it.
node/composeVisitors.js:83 also uses optional chaining (?., Node 14.0), which rules out 12 and 13 on that path.
Verified against [email protected], freshly downloaded from npm.
Reproduce
npm i [email protected]
node -e "require('lightningcss')" # on Node 12/13/14or, without needing those runtimes installed, the same check the parser makes:
new Function('res', 'res.dependencies ??= [];') // SyntaxError before Node 15The honest caveat
Node 12, 13 and 14 are all end-of-life, so I doubt anyone is actually hitting this. What is concrete is that the manifest states a floor the shipped code does not meet, and engines is read by installers and by tooling that gates on it — npm warns, and some CI setups fail on the mismatch rather than warn.
Fix
Either raise the floor to match what is shipped (>= 16 would cover both forms with room to spare), or transpile the two constructs. The floor is the smaller change and is the one that makes the manifest true.
Notes
Found by an automated checker I'm building that compares a package's declared engines.node against the first Node version that can parse the syntax in its shipped entry points. I verified this one by hand against the published 1.33.0 tarball and searched the open and closed issues for an existing report before filing.
Source: parcel-bundler/lightningcss