Skip to content

NXT-19371: resolve webpack version mismatch causing parser.getLocatio… - #874

Merged
daniel-stoian-lgp merged 2 commits into
developfrom
feature/NXT-19371
Aug 25, 2026
Merged

NXT-19371: resolve webpack version mismatch causing parser.getLocatio…#874
daniel-stoian-lgp merged 2 commits into
developfrom
feature/NXT-19371

Conversation

@hong6316

Copy link
Copy Markdown
Contributor

Checklist

  • I have read and understand the contribution guide
  • A CHANGELOG entry is included
  • I have run automated testing and it is passed
  • Documentation was added or is not needed
  • This is an API breaking change

Issue Resolved / Feature Added

The build fails during the Storybook webpack build with:

Module parse failed: parser.getLocation is not a function
TypeError: parser.getLocation is not a function
  at constDependency (JavascriptParserHelpers.js:129:20)
  at DefinePlugin.js:951:10

Two conflicting webpack versions are installed simultaneously:

  • webpack@5.107.2 — pinned in devDependencies (the "host" webpack used by Storybook)
  • webpack@5.109.2 — installed nested under @enact/dev-utils/node_modules/ (resolved from peer dependencies)

When @enact/dev-utils's ILibPlugin does require('webpack'), it resolves to the nested 5.109.2 copy. The DefinePlugin from 5.109.2 registers parser hooks that call parser.getLocation() — a method introduced in webpack 5.108+. However, the actual parser instance comes from the host's webpack 5.107.2, which does not have this method, causing the TypeError.

Resolution

  1. Update storybook from ^10.4.6 to ^10.5.10 to align with the version npm resolves for nested dependencies

Additional Considerations

Links

NXT-19371

Comments

Enact-DCO-1.0-Signed-off-by: Taeyoung Hong (taeyoung.hong@lge.com)

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.60%. Comparing base (e791446) to head (6ad17b0).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #874   +/-   ##
========================================
  Coverage    85.60%   85.60%           
========================================
  Files          118      118           
  Lines         4495     4495           
  Branches      1226     1226           
========================================
  Hits          3848     3848           
  Misses         503      503           
  Partials       144      144           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -1,22 +0,0 @@
diff --git a/node_modules/storybook/dist/manager/globals-runtime.js b/node_modules/storybook/dist/manager/globals-runtime.js

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here. why was this removal needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had deleted this patch because it caused a build error.

Upon re-verification, I found that the patch was incompatible with the Storybook version, so I recreated it as v10.5.10.

@daniel-stoian-lgp
daniel-stoian-lgp merged commit b94c0a5 into develop Aug 25, 2026
10 checks passed
@daniel-stoian-lgp
daniel-stoian-lgp deleted the feature/NXT-19371 branch August 25, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants