Frontmatter
| id | 9582 |
| title | Bug: Webpack fails due to unanchored `webpackInclude` picking up Node modules |
| state | Closed |
| labels | bugaibuild |
| assignees | tobiu |
| createdAt | Mar 27, 2026, 2:58 PM |
| updatedAt | Mar 27, 2026, 3:18 PM |
| githubUrl | https://github.com/neomjs/neo/issues/9582 |
| author | tobiu |
| commentsCount | 0 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Mar 27, 2026, 3:18 PM |
The removal of the
^anchor in#9580and#9581resolved 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.mjsmatchedexamples/./apps/devindex/services/Manager.mjsmatchedapps/./examples/form/field/fileupload/server.mjsmatchedexamples/This resulted in Webpack attempting to bundle Node core modules (
node:stream,node:util), throwingUnhandledSchemeError. The fix anchors the regex correctly with^\.\/to strictly target the intended folders at the root, and addsserver\.mjsanddevindex\/servicestowebpackExcludeas negative safeties against mixing backend scripts into worker chunk maps.