GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Parenthesized accessor call breaks ASI between adjacent require() statements in concatenated modules (regression in 5.110.3) · Issue #21956 · webpack/webpack Closed as not planned Closed as not planned Copy link Labels area: optimizationTree-shaking, splitChunks, concatenation, ids (lib/optimize, lib/ids)area: runtimeEmitted runtime and chunk loading across targets (lib/runtime, lib/web, lib/node, lib/esm)regressionWorked in a previous release; pair with the Affected version field Description
Bug DescriptionParenthesizing a wrapped module's accessor call (#21876, shipped in v5.110.3) defeats automatic semicolon insertion between two adjacent Two The module reference is emitted as https://github.com/webpack/webpack/blob/main/lib/optimize/ConcatenatedModule.js#L984 return asiSafe === false ? `;(${reference})` : `(${reference})`; At this position This is not a "you forgot a semicolon" problem: the input is valid JavaScript that v5.110.2 and every earlier version compiled correctly, and nothing warns. Link to Minimal Reproduction and steps to reproduceFour files, no dependencies beyond
import X from "./x"; window.X = X; require("./a") require("./b");
export default function X() { return 42; }
window.a = true;
window.b = true;
const path = require("path"); module.exports = { mode: "production", entry: path.resolve(__dirname, "src/index.js"), output: { path: path.resolve(__dirname, "dist"), filename: "bundle.js" } }; Steps:
Expected BehaviorThe two window.X = X; a_namespaceFn() b_namespaceFn(); Both modules are evaluated, the bundle runs. Actual BehaviorSince v5.110.3 the accessor calls are parenthesized without an ASI guard, so the second becomes an argument to the first: window.X = X; (a_namespaceFn()) (b_namespaceFn()); Minified, this is the end of the bundle: (()=>{"use strict";window.X=function(){return 42},o(967)(o(170))})()
EnvironmentAdditional ContextBisectSame reproduction, only the webpack version changed:
Terser is not involved — the collapse is already present in the unminified output, and crossing the versions confirms it:
AttributionPatching the line above in an installed v5.110.3 isolates the cause to #21876:
For completeness: #21907 landed in the same release and removed the ImpactAny codebase with two adjacent Note on AI usageThe reproduction, the bisect, the version crossing and the attribution were produced with Claude Code. Every number in the tables comes from an actual build in an isolated directory, not from reading the source. Activity
MetadataMetadataAssigneesLabelsarea: optimizationTree-shaking, splitChunks, concatenation, ids (lib/optimize, lib/ids)area: runtimeEmitted runtime and chunk loading across targets (lib/runtime, lib/web, lib/node, lib/esm)regressionWorked in a previous release; pair with the Affected version field TypeFieldsPriority None yet ProjectsMilestoneRelationshipsDevelopmentIssue actions | |||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |