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

Builder not working right with Angular Material - Attempting to attach an unknown Portal type #801

Open
1 of 2 tasks
JuNe98 opened this issue Mar 21, 2025 · 1 comment
Open
1 of 2 tasks

Comments

@JuNe98
Copy link

JuNe98 commented Mar 21, 2025

With what library do you have an issue?

native-federation

Reproduction of the bug/regression with instructions

I am using this lib in an NX monorepo. I am implementing a header-nav in a publishable lib which contains a mat-menu. When I try to use this header-nav and click the mat-menu trigger, I get the following error:

Image

I have already opened a ticket at the official Angular components repo and @devversion could confirm that with your builder two CDK version are existing: angular/components#30686 (comment)

I have already built a reproduction of the error in a public repo: https://github.com/JuNe98/nx-menu-bug

I also can confirm that the error only come up in Angular Material Version 19.2.4 or newer. 19.2.3 works fine.

Expected behavior

I would expect open the mat-menu causing no error.

Versions of Native/Module Federation, Angular, Node, Browser, and operating system

Native Federation: 19.0.16
Angular: 19.2.3
Angular Material: >=19.2.4

Other information

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No
@devversion
Copy link

I don't have a lot of context about Module Federation here, but out of curiosity I've looked more. I believe the issue could be?! that the shared chunks that are now part of e.g. @angular/cdk/fesm2022 aren't picked up as "shared" because (thesis) this plugin/federation only picks up the chunk specified in the exports[entrypoint].default export condition?

for (const key of keys) {
// const relPath = exports[key]['default'];
const secondaryName = path.join(parent, key).replace(/\\/g, '/');
if (exclude.includes(secondaryName)) {
continue;
}
result[secondaryName] = {
...shareObject,
// import: path.join(libPath, relPath)
};
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants