LearnNewsExamplesServices
Frontmatter
id9599
titleWebpack path resolution bug for Data worker dynamic imports in workspaces
stateClosed
labels
bugai
assigneestobiu
createdAtMar 30, 2026, 12:51 PM
updatedAtMar 30, 2026, 1:02 PM
githubUrlhttps://github.com/neomjs/neo/issues/9599
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMar 30, 2026, 1:01 PM

Webpack path resolution bug for Data worker dynamic imports in workspaces

Closedbugai
tobiu
tobiu commented on Mar 30, 2026, 12:51 PM

Description When running npm run build-all inside a workspace (e.g., generated by create-app), Webpack throws "Module not found" warnings when trying to process dynamic imports for connection, parser, and normalizer modules inside Neo.worker.Data.

WARNING in ./node_modules/neo.mjs/src/worker/Data.mjs 131:26-136:21
Module not found: Error: Can't resolve '../../../data/connection' in '/Users/tobiasuhlig/Desktop/workspace/node_modules/neo.mjs/src/worker'

Root Cause The ContextReplacementPlugin in the Webpack worker configurations blindly prepends ../../ to dynamic import requests inside /src/worker when insideNeo is false (in a workspace context), unless the request already starts with ../../. Because the internal Data.mjs imports use ../data/connection/${name}.mjs, the plugin incorrectly transforms ../data/connection to ../../../data/connection, breaking the resolution.

Resolution Update the ContextReplacementPlugin logic across all appworker and worker Webpack configs (Development and Production) to also exclude requests starting with ../data/, preserving the internal framework paths while still correctly redirecting external workspace paths.

tobiu added the bug label on Mar 30, 2026, 12:51 PM
tobiu added the ai label on Mar 30, 2026, 12:51 PM
tobiu referenced in commit 5723fde - "fix(build): Fix Webpack ContextReplacementPlugin path resolution for Data worker dynamic imports within external workspaces (#9599)" on Mar 30, 2026, 1:01 PM
tobiu closed this issue on Mar 30, 2026, 1:01 PM
tobiu
tobiu Mar 30, 2026, 1:01 PM

Input from Gemini 3.1 Pro (Antigravity):

✦ The path resolution bug for Data worker dynamic imports in external workspaces has been fixed.

  • Issue: The ContextReplacementPlugin in the Webpack worker configs was incorrectly prepending ../../ to framework-internal data paths (e.g., ../data/connection/...), resulting in broken ../../../data/... imports in workspace builds.
  • Fix: Added a surgical exclusion to the plugin logic (&& !context.request.startsWith('../data/') and && !context.request.startsWith('..\\data\\')) across all four development and production appworker/worker configuration files.

Framework paths now resolve correctly as-is within node_modules, while falling back to workspace path prefixing for other non-exempt relative imports.

tobiu assigned to @tobiu on Mar 30, 2026, 1:02 PM