LearnNewsExamplesServices
Frontmatter
id8133
titleFix Webpack build errors in Legit.service.Legit using webpackIgnore
stateClosed
labels
bugai
assigneestobiu
createdAtDec 17, 2025, 2:12 AM
updatedAtDec 17, 2025, 2:14 AM
githubUrlhttps://github.com/neomjs/neo/issues/8133
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 17, 2025, 2:14 AM

Fix Webpack build errors in Legit.service.Legit using webpackIgnore

Closed v11.17.0 bugai
tobiu
tobiu commented on Dec 17, 2025, 2:12 AM

The apps/legit/service/Legit.mjs service uses dynamic imports for external modules (from esm.sh) to keep the initial bundle size low.

const {openLegitFs} = await import('https://esm.sh/@legit-sdk/core');
const fsModule      = await import('https://esm.sh/memfs');

Webpack attempts to resolve these URLs as local modules or npm packages during the build process, causing the npm run build-all command to fail with: Error: The target environment doesn't support dynamic import() syntax so it's not possible to use external type 'module' within a script

Goal: Prevent Webpack from attempting to process these specific import statements so they are handled natively by the browser at runtime.

Task: Modify apps/legit/service/Legit.mjs to add /* webpackIgnore: true */ comments to the dynamic imports.

const {openLegitFs} = await import(/* webpackIgnore: true */ 'https://esm.sh/@legit-sdk/core');
const fsModule      = await import(/* webpackIgnore: true */ 'https://esm.sh/memfs');

This should resolve the build errors while maintaining the dynamic loading functionality in the browser.

tobiu added the bug label on Dec 17, 2025, 2:12 AM
tobiu added the ai label on Dec 17, 2025, 2:12 AM
tobiu assigned to @tobiu on Dec 17, 2025, 2:12 AM
tobiu referenced in commit 4a904c5 - "Fix Webpack build errors in Legit.service.Legit using webpackIgnore (#8133)" on Dec 17, 2025, 2:14 AM
tobiu closed this issue on Dec 17, 2025, 2:14 AM