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 — output.library.type: 'module' defaults output.module to false, emitting invalid JavaScript (export inside IIFE) · Issue #22061 · webpack/webpack Closed Labels area: configOptions, defaults, validation (lib/config, schemas/)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 DescriptionHave you used AI?Yes Which part of webpack is affected?config (options, defaults, validation) Bug DescriptionFollowing #22011 / commit However, in F(output, "module", () => Boolean( tp && ((tp.node === null && tp.web === null && tp.module !== false) || tp.deno === true || tp.bun === true) ) ); When building an ESM library (e.g. for module.exports = { output: { library: { type: "module" } } }; (or on an entry via
(() => { // ... let __webpack_exports__ = __webpack_require__("./index.js"); export default __webpack_exports__; })();
Additionally, if a user explicitly sets Link to Minimal Reproduction and steps to reproduceMinimal reproduction script: const webpack = require("webpack"); const vm = require("vm"); const fs = require("fs"); const path = require("path"); const outDir = path.resolve("./dist-repro"); webpack({ mode: "development", entry: "./test/fixtures/a.js", output: { path: outDir, filename: "bundle.js", library: { type: "module" } } }, (err, stats) => { if (err) throw err; const code = fs.readFileSync(path.join(outDir, "bundle.js"), "utf8"); try { new vm.Script(code); console.log("Syntax is valid!"); } catch (e) { console.error("Syntax Error in emitted bundle:", e.message); } fs.rmSync(outDir, { recursive: true, force: true }); }); Steps:
Expected Behavior
Actual Behavior
EnvironmentSystem: Is this a regression?Yes (please specify version below) Last Working VersionIntroduced in #22011 / commit Activity
MetadataMetadataAssigneesLabelsarea: configOptions, defaults, validation (lib/config, schemas/)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. |