Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(enhanced): Do not inject the federation runtime into build time chunk #3225

Open
5 tasks done
lnlfps opened this issue Nov 14, 2024 · 1 comment
Open
5 tasks done

Comments

@lnlfps
Copy link

lnlfps commented Nov 14, 2024

Describe the bug

When working with umijs or father, during the compilation of less modules, some 'build time chunks' are generated. These temporary chunks lack chunkGraph information, leading to errors when generating runtime code.

// enhanced/scr/lib/container/runtime/FederationRuntime.ts 49

const conditionMap = this.compilation.chunkGraph.getChunkConditionMap(
  this.chunk,
  chunkHasJs,
);

Then The current chunk id is build time chunk, the variable this.compilation.chunkGraph is undefined,causing an exception to be thrown

Suggestion

If the chunk's id is build time chunk, do not inject the federation runtime to this chunk. like this:

image

Reproduction

Used Package Manager

npm

System Info

-

Validations

@ScriptedAlchemy
Copy link
Member

Send a pull request

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

No branches or pull requests

2 participants