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 — #20221 module existence check breaks `interceptModuleExecution` recovery for missing modules · Issue #20475 · webpack/webpack Closed Bug Copy link DescriptionBug DescriptionThe module existence check added in #20221 (shipped in v5.104.0) changes the observable control flow of What is the current behavior?When function __webpack_require__(moduleId) { // 1. Cache check var cachedModule = __webpack_module_cache__[moduleId]; if (cachedModule !== undefined) return cachedModule.exports; // 2. NEW: pathinfo existence check — throws here if (__webpack_modules__[moduleId] === undefined) { var e = new Error("Cannot find module '" + moduleId + "'"); e.code = 'MODULE_NOT_FOUND'; throw e; } // 3. Create module var module = __webpack_module_cache__[moduleId] = { ... }; // 4. interceptModuleExecution — never reached var execOptions = { id: moduleId, module: module, factory: __webpack_modules__[moduleId], require: __webpack_require__ }; __webpack_require__.i.forEach(function(handler) { handler(execOptions); }); ... } Previously (≤v5.103), when What is the expected behavior?The
How is this affecting a real-world project?Next.js uses // If the original factory is missing, e.g. due to race condition // when compiling multiple entries concurrently, recover by doing // a full page reload. 'if (!originalFactory) {', Template.indent('document.location.reload();'), Template.indent('return;'), '}', This handles a legitimate scenario in development: during HMR with concurrent server component rendering, React's Flight protocol can serialize client references from one page that aren't present in another page's webpack module registry. The old behavior allowed the React Refresh interceptor to catch this and reload; the new check makes it a hard error before the interceptor runs. Link to Minimal Reproduction and step to reproducecheckout vercel/next.js#89569 which updates webpack for next.js to 5.105 Expected Behaviorthe test should continue passing as interception hooks should be able to run before the dev mode missing module check Actual Behaviorloading a missing module immediately fails with an Error Environment- webpack: 5.105.0 (also affects 5.104.0+) - Node.js: v22.x - OS: macOS Is this a regression?Yes (please specify version below) Last Working Versionv5.98.0 Additional ContextNo response Activity
MetadataMetadataAssigneesLabelsNo labels TypeFieldsPriority None yet Effort 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. |