fluentui-blazor: Stack overflow in main web-components library when using FluentCard together with FluentDesignSystemProvider
π Bug Report
This was a tricky one to isolate!
When FluentDesignSystemProvider (i.e. in Routes.razor) is in use, adding
a FluentCard component to any pages results in the following exception,
visible in the developer tools:
web-components-v2.5.16.min.js:21 Uncaught RangeError: Maximum call stack size exceeded
at d (web-components-v2.5.16.min.js:21:88279)
at b (web-components-v2.5.16.min.js:21:89056)
at Kn (web-components-v2.5.16.min.js:21:89167)
at Object.evaluate (web-components-v2.5.16.min.js:21:98645)
at c.<anonymous> (web-components-v2.5.16.min.js:21:98786)
at c.observe (web-components-v2.5.16.min.js:1:4877)
at uo.handleChange (web-components-v2.5.16.min.js:16:93313)
at c.notify (web-components-v2.5.16.min.js:1:3138)
at c.call (web-components-v2.5.16.min.js:1:5462)
at u.notify (web-components-v2.5.16.min.js:1:3138)
If multiple cards are in place, this causes serious performance issues and breaks some behavior (i.e. theming seems to stop working after this exception).
π» Repro or Code Sample
https://github.com/kzu/fluentui-bug/
Steps:
-
Clone repo
-
Run. If running with the VS debugger, the javascript exception will be visible in the Debug output pane, otherwise, it can be seen in the browser developer tools
-
Remove or comment out the
FluentDesignSystemProviderfromRoutes.razor=> the error dissapears -
Alternatively, remove or comment out the
FluentCardfromHome.razor(while keeping theFluentDesignSystemProvider) => likewise, the error dissapears.
π€ Expected Behavior
No exceptions should happen because of using either the FluentDesignSystemProvider or the FluentCard.
π Your Environment
- Browser: Microsoft Edge
- Web-components: web-components-v2.5.16.min.js
- FluentUI: Microsoft.FluentUI.AspNetCore.Components v4.1.1
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (2 by maintainers)
Issue created: https://github.com/microsoft/fluentui/issues/30055
Iβve switched for now to the new
FluentDesignThemewhich works fine in combination withFluentCard.And for the stroke (which I also needed), Iβm just using the design token around the routes:
With this combination, Iβm effectively unblocked for now π
@kzu @vnbaaij That could be interesting to add a new attribute to the
FluentDesignThemeto specify all other DesignTokens properties. Example:V4 is .NET 8 only. It has a new name(space) : Microsoft.FluentUI.AspNetCore.Components. Upgrading is not too hard but also not next, next, finish. See the docs site
Daniel (@kzu), glad you are unblocked! Iβll keep this one open to track the issue in the fluent repo.
Surely here it is
Thanks @pk9r327 for chasing that down!
@kzu as it is a bug in the underlying web components, we canβt fix it here (before v4.2) . Iβll raise an issue in the web components repo on this.
i tried @fluentui/web-components and it probably had the same problem. I see it happening when
fluent-design-system-providersets theaccent-base-colorvalue and thefluent-cardtag is inside adivtag.