You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bare-major browserslist target (e.g. safari 10) reports features supported at <major>.0 as unsupported #22278
When a browserslist target is given at a bare major version (no minor component, e.g. safari 10), webpack's browserslist target handler treats the environment as not supporting a feature whose first supported version is expressed as a [major, minor] pair (e.g. const/let, first supported at safari [10, 0]). The target actually supports the feature, so the runtime capabilities webpack derives from target: "browserslist" are more conservative than they should be.
The cause is in lib/config/browserslistTargetHandler.js. When the resolved version has no minor component, the minor coerces to NaN, and the equal-major comparison Number(parserMinor) >= requiredVersion[1] becomes NaN >= 0, which is false. So safari 10 fails the check that safari 10.0 passes.
Note that browserslist itself emits bare-major strings such as safari 10 (not safari 10.0) for several queries, so this is reachable from ordinary configuration.
Link to Minimal Reproduction and steps to reproduce
No separate repo needed — this is reproducible directly against the target handler:
resolve(["safari 10"]) and resolve(["safari 10.0"]).
Compare the const (or let, arrow function, etc.) capability.
The bare-major form reports const: false while the .0 form reports const: true, even though they denote the same browser version.
Expected Behavior
A bare-major target is equivalent to <major>.0, so resolve(["safari 10"]) should equal resolve(["safari 10.0"]), and const/let should be reported supported at the exact major where support begins.
Actual Behavior
resolve(["safari 10"]).const === false, disagreeing with resolve(["safari 10.0"]).const === true. Features first supported at <major>.0 are wrongly reported unsupported whenever the target omits the minor.
Environment
webpack: 5.111.1 (also present on current main; the file was relocated but the logic is unchanged)
Node: 20.20.0
OS: Windows 11
Is this a regression?
No
Last Working Version
Additional Context
Fix: treat a missing minor as 0 in the equal-major branch. A PR follows.
Activity
alexander-akait commentedon Sep 24, 2026
No need to create an issue if you already sent a PR, it creates more spam than fix real bugs/problems
Eshiv-Pandey commentedon Sep 24, 2026
would keep tht in mind from next time