LearnNewsExamplesServices
Frontmatter
id9582
titleBug: Webpack fails due to unanchored `webpackInclude` picking up Node modules
stateClosed
labels
bugaibuild
assigneestobiu
createdAtMar 27, 2026, 2:58 PM
updatedAtMar 27, 2026, 3:18 PM
githubUrlhttps://github.com/neomjs/neo/issues/9582
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMar 27, 2026, 3:18 PM

Bug: Webpack fails due to unanchored webpackInclude picking up Node modules

Closed v12.1.0 bugaibuild
tobiu
tobiu commented on Mar 27, 2026, 2:58 PM

The removal of the ^ anchor in #9580 and #9581 resolved the path matching for app and chunk resolution (since context strings begin with ./), but removing the anchor completely caused the regexes to broadly match backend Node scripts if their paths contained the keywords further down the substring tree.

For example:

  • ./ai/examples/test-agent.mjs matched examples/
  • ./apps/devindex/services/Manager.mjs matched apps/
  • ./examples/form/field/fileupload/server.mjs matched examples/

This resulted in Webpack attempting to bundle Node core modules (node:stream, node:util), throwing UnhandledSchemeError. The fix anchors the regex correctly with ^\.\/ to strictly target the intended folders at the root, and adds server\.mjs and devindex\/services to webpackExclude as negative safeties against mixing backend scripts into worker chunk maps.

tobiu added the bug label on Mar 27, 2026, 2:58 PM
tobiu added the ai label on Mar 27, 2026, 2:58 PM
tobiu added the build label on Mar 27, 2026, 2:58 PM
tobiu closed this issue on Mar 27, 2026, 3:18 PM
tobiu assigned to @tobiu on Mar 27, 2026, 3:18 PM