Skip to content

Conversation

@xiaoxiaojx
Copy link
Member

@xiaoxiaojx xiaoxiaojx commented Nov 13, 2025

Summary
The root cause of this issue is that both ImportDependency and ModuleHotAcceptDependency can be used to generate a module (e.g., ./info.json). ImportDependency includes import attributes, but ModuleHotAcceptDependency does not. If ModuleHotAcceptDependency appears first, the generated module (./info.json) will lack import attributes, which means it can’t match type: "json". As a result, it gets treated as a JavaScriptModule, leading to a parsing error.

What kind of change does this PR introduce?
bugfix

Did you add tests for your changes?
Yes

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?
Nothing

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 13, 2025

CodSpeed Performance Report

Merging #20124 will not alter performance

Comparing xiaoxiaojx:fix/import_attr (8debd3d) with main (102e1a4)

Summary

✅ 69 untouched

super();
this.request = request;
this.userRequest = request;
this.sourceOrder = sourceOrder;
Copy link
Member

Choose a reason for hiding this comment

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

Don't forget to write it in serilizer and deserilizer

@alexander-akait alexander-akait merged commit d4208ba into webpack:main Nov 14, 2025
50 of 51 checks passed
@alexander-akait
Copy link
Member

Thanks

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