Skip to content

fix: failed to parse bundle with IIFE - #685

Merged
valscion merged 4 commits into
webpack:mainfrom
hai-x:fix-entry-iife
Jan 7, 2026
Merged

valscion merged 4 commits into
webpack:mainfrom
hai-x:fix-entry-iife

Conversation

@hai-x

@hai-x hai-x commented Dec 15, 2025 •

Copy link
Copy Markdown
Member

Summary

What kind of change does this PR introduce?

Fixes #684, #409.

Did you add tests for your changes?

It seems we currently don’t support parsing top-level chunk modules and i’m also not sure whether parsing is the right approach for get rendered chunk modules.

e.g.

const __webpack_modules__ = [,,,...]

So i add one simple IIFE case here without chunk modules.

Here is test result before fixing:
image

Does this PR introduce a breaking change?

No

If relevant, what needs to be documented once your changes are merged or what have you already documented?

No

@alexander-akait

Copy link
Copy Markdown
Member

@evenstensberg We need to add test cases

@evenstensberg evenstensberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Needs test cases 😄

@valscion valscion left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hmm yeah this might work but it looks like we would not be parsing any modules when this IIFE bundle is used? Is that expected?

Anyway, this looks good! Could you still add a changelog entry?

@alexander-akait

Copy link
Copy Markdown
Member

@valscion In this case there are no modules, anyway in our TODOs to add all test cases for ES modules with and without IIFE, it is just an edge case

@valscion

Copy link
Copy Markdown
Collaborator

Yeah that's true. I'll add a changelog entry myself when I have the time or then @hai-x can add one — I'll merge once the changelog is there and release when I have a good slot :)

@valscion valscion left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's go

@hai-x

hai-x commented Jan 7, 2026

Copy link
Copy Markdown
Member Author

@valscion I'm so sorry, I missed the message and forgot to reply. Thank you for your help. ❤️

@valscion
valscion merged commit bfd8aab into webpack:main Jan 7, 2026
@valscion

valscion commented Jan 7, 2026

Copy link
Copy Markdown
Collaborator

Sure, not a problem @hai-x! ☺️

@valscion

valscion commented Jan 7, 2026

Copy link
Copy Markdown
Collaborator

Released in v5.1.1. Thanks for the contribution!

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.

When output.module is true: Cannot read properties of undefined (reading 'arguments')

4 participants