Skip to content

module federation v1.5+ Error: should have __webpack_require__.f.consume #6773

@ahabhgk

Description

@ahabhgk
          @ahabhgk I was finally able to reproduce the issue, there you go: https://github.com/markmssd/module-federation-runtime-shared/tree/rspack-0.7.2-canary.

It's a problem only with dynamic imports. In this repro, it would be app1/src/DynamicPage.js. Editing this file will result in this error:

Screenshot 2024-06-07 at 8 20 03 PM

If you edit any other page, for example app1/src/App.js, it does not happen. I've also noticed that commenting out ModuleFederationPlugin in app1/rspack.config.js would fix it (however we wouldn't have Module Federation anymore so it's not really a solution, but could help pinpoint the issue).

Also, once the error happens, you can refresh the page and then you'll be able to edit the DynamicPage without any errors anymore. That means you'll need to stop/start the app again in order to reproduce.

Let me know if you need more info, I'd be glad to help further.

Originally posted by @markmssd in #6740 (comment)

Metadata

Metadata

Assignees

Labels

teamThe issue/pr is created by the member of Rspack.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions