SPFx 1.22.x / 1.23 throws Cannot read properties of undefined (reading 'set') in debug mode when using Fluent UI React v9 components
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
Windows
What browser(s) / client(s) have you tested
- [ ] 💥 Internet Explorer
- [x] 💥 Microsoft Edge
- [x] 💥 Google Chrome
- [ ] 💥 FireFox
- [ ] 💥 Safari
- [ ] mobile (iOS/iPadOS)
- [ ] mobile (Android)
- [ ] not applicable
- [ ] other (enter in the "Additional environment details" area below)
Additional environment details
- browser version 148.0.7778.217
- SPFx version 1.22.x & 1.23
- Node.js version 22.14.0 -Fluent UI 9 - Tested with 9.56.6 - 9.66.6, 9.74.1
Describe the bug / error
When the web part is loaded from localhost, the following exception is thrown in the browser console:
TypeError: Cannot read properties of undefined (reading 'set')
Stack trace:
TypeError: Cannot read properties of undefined (reading 'set')
at getModalizer (https://localhost:4321/dist/promotion-portal-web-part.js:96165:34)
at initTabsterModules (https://localhost:4321/dist/promotion-portal-web-part.js:34449:58)
at https://localhost:4321/dist/promotion-portal-web-part.js:34673:40
at https://res-1.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_*.js
The stack trace consistently points to Tabster initialization (getModalizer / initTabsterModules).
Steps to reproduce
- Create an SPFx web part using SPFx 1.22.2 or 1.23.
- Install Fluent UI React v9 (@fluentui/react-components).
- Use Fluent UI v9 controls within the web part.
- Run the solution using: npm run start
- Open the SharePoint page that hosts the web part.
Additional Information
- Reproduced in SPFx 1.22.2 and 1.23.
- Reproduced with multiple Fluent UI React v9 versions.
- Only observed when running from localhost in debug mode.
- The issue appears related to Tabster initialization which was previously working fine.
Expected behavior
Fluent UI React v9 components should work without throwing getModalizer / initTabsterModules errors, even when running in local debug mode
for now I have fixed by adding this function in the webpart.ts file
private _patchTabsterInstance(): void {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const tabsterInstance = (window as any).__tabsterInstance;
if (tabsterInstance && !tabsterInstance.attrHandlers) {
tabsterInstance.attrHandlers = new Map();
}
}
And using it in the render method
public render(): void {
// Ensure Tabster compatibility before each render cycle.
// This handles the race where SharePoint's Tabster might
// initialize between onInit() and render().
this._patchTabsterInstance();
const element: React.ReactElement<IPromotionPortalProps> = React.createElement(PromotionPortal, {
description: this.properties.description,
isDarkTheme: this._isDarkTheme,
environmentMessage: this._environmentMessage,
hasTeamsContext: !!this.context.sdks.microsoftTeams,
userDisplayName: this.context.pageContext.user.displayName,
});
ReactDom.render(element, this.domElement);
}
and in render method
protected onInit(): Promise<void> {
return this._getEnvironmentMessage().then((message) => {
this._environmentMessage = message;
this._patchTabsterInstance();
});
}
@HarminderSethi, I've confirmed this issue in our lab environment with SPFx 1.23.0 + Fluent UI v9.66.6. The vulnerable state exists: window._tabsterInstance is present but attrHandlers is missing, causing Cannot read properties of undefined (reading 'set') when Fluent UI components initialize. Escalating this bug to our engineering team for root cause analysis and permanent fix.
We had the same issue here, we fixed it by adding the following options in package.json :
{
"resolutions": {
"tabster": "8.5.5"
},
"overrides": {
"tabster": "8.5.5"
}
}
Hope it will fix your issue while Microsoft is looking at it. Have a nice day!
We can confirm the same issue and add a few observations from our investigation.
In our case, the problem was not limited to a Web Part or to code running from localhost. We observed the same Cannot read properties of undefined (reading 'set') exception with custom SPFx packages loaded on a regular SharePoint Online modern page, including an Application Customizer.
The custom code did not import or use tabster or @fluentui/react-tabster directly. It only used Fluent UI React v9 through:
@fluentui/react-components
Tabster was introduced transitively through:
@fluentui/react-components
└── @fluentui/react-tabster
└── tabster
Therefore, this issue can affect any custom SPFx package that directly uses Fluent UI React v9, including Web Parts, Application Customizers and shared libraries, even when the application code contains no direct Tabster integration.
Additional diagnostic results:
- The normal SharePoint page failed with multiple
reading 'set'exceptions. - The exceptions originated from Tabster-related mover/groupper paths inside
sp-pages-assembly. - Loading the same page with
disable3PCode=1prevented the fatal error. - Bundle inspection confirmed that the affected custom SPFx asset included Tabster transitively through Fluent UI React v9.
- Removing or unloading the affected custom SPFx component allowed the page to render.
- We also observed the same error signature with a deployed SPFx bundle, so the impact may not be limited to localhost/debug mode.
Current workaround
We resolved the issue in our custom SPFx package by aligning it with the latest Fluent UI React v9 release and ensuring that the resulting dependency tree contained only one compatible Tabster chain.
The versions used in the working configuration were:
{
"dependencies": {
"@fluentui/react-components": "9.74.7",
"@fluentui/react-icons": "2.0.339"
}
}
After reinstalling and deduplicating the dependencies, the resolved tree was:
@fluentui/[email protected]
└── @fluentui/[email protected]
└── [email protected]
We verified the dependency tree with:
npm ls @fluentui/react-components @fluentui/react-tabster tabster --all
After a clean rebuild using the updated Fluent UI React v9 dependency tree, the SharePoint page rendered normally and the reading 'set' error was no longer generated.
No changes to the custom application logic were required, since the application was not using Tabster directly.
This appears to indicate a runtime compatibility issue between older Fluent UI React v9/Tabster versions bundled by custom SPFx packages and the Tabster implementation expected by the current SharePoint Online page assembly.
Exact same behaviour here in our solution. @Ashlesha-MSFT any official guidance on how/when a permanent fix is being provided?
Cross linking the issue from microsoft/tabster#557 which seems to be a SharePoint issue and same root cause problem is this one.
Will flag this internally now as higher priority for engineering, so that we can see what we can do here. Unfortunately issue has remained under the radar, but let's try to get this now solved asap.
11. Cross linking the issue from microsoft/tabster#557 which seems to be a SharePoint issue and same root cause problem is this one. Will flag this internally now as higher priority for engineering, so that we can see what we can do here. Unfortunately issue has remained under the radar, but let's try to get this now solved asap.
@VesaJuvonen when these issues started to spread consistently across all tenants about two months ago, we also noticed the new (not seen until these issues) "Sorry, Something went wrong" screen that blanks completely the web part canvas on any of these errors started to propagate not only based on these issues but also with a variety of sources really hard to reproduce. Some examples of details copied from these like the one below many users have seen not only in pages with customized web parts but also SharePoint pages purely out of the box with Microsoft web parts only. We never manage to reproduce this consistently just happens sometimes when navigating back and forth in between pages.
Many of this if not all seems to be sourced in race conditions between different versions of react 17, 18 and even 19 sometimes, something unseen until these issues started. The overall perception from our users (internally and across many customers) is that the stability of SharePoint is deteriorating very fast given the new way to crash doesn't just crash a web part affected but the whole rendering of the web part page.
I appreciate your involvement and hopefully these sheds some additional light as tabster was just one root cause to these issue happening, but there seems to be many that are really hard to identify like the one below and an underlying issue the makes them a lot worse which is the whole canvas rendering blowing out on any of this happening which to me is the actual issue to be fixed (if possible at all).
ISSUE 1 useEffect Cannot read properties of null (reading 'useEffect')
at Z (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:503:15578)
at https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:518:119
at l (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:520:10013)
at article
at h (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:842:676)
at div
at D (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:520:12970)
at Z (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:503:15578)
at https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:518:119
at ar (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:832:17713)
at k (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:779:1204)
at c (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:275:105169)
at m (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:215:829)
at b (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:211:321)
at b (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:209:724)
at b (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:211:321)
at bP (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:972:82692)
at section
at div
at div
at FocusRectsProvider (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:158:309212)
at https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:275:74752
at https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:158:316063
at b (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:158:282115)
at am (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:487:33920)
at aq (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:487:34408)
at div
at af (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:158:13566)
at https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:158:26602
at https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:487:35097
at af (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:158:13566)
at https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:487:39268
at br (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:487:78445)
at c (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:275:105169)
at bO (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:487:92066)
at b (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:429:646)
at b5 (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-us_6d82fa7bdeb34e55b0b6f10967689894.js:487:120008)
ISSUE 2 requirejs: Mismatched anonymous define() module: function(){return m} https://requirejs.org/docs/errors.html#mismatch
at Lazy
at Suspense
at S
at div
at div
at dw (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:593:162691)
at dT (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:170:87012)
at f (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:170:107638)
at article
at h (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:830:676)
at div
at D (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:439:12970)
at Z (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:370:15578)
at https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:437:119
at am (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:820:17078)
at k (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:766:1204)
at c (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:174:105169)
at m (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:109:829)
at b (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:105:321)
at b (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:103:724)
at b (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:105:321)
at bQ (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:961:81756)
at section
at div
at div
at FocusRectsProvider (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:170:112664)
at https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:174:74752
at https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:170:119515
at b (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:170:85567)
at am (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:593:33771)
at aq (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:593:34259)
at div
at af (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:10:13566)
at https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:10:26602
at https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:593:34948
at af (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:10:13566)
at https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:593:39119
at br (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:593:78570)
at c (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:174:105169)
at bO (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:593:92193)
at b (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:534:646)
at b5 (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_1_en-gb_ef594402ac4e76d64cae501fa621b861.js:593:120135)
ISSUE 3 Loading chunk failed: Loading chunk 2877 failed. (error: https://res.public.onecdn.static.microsoft/files/sp-client/chunk.2877_none_79a91adb87d2c526e893.js)
at Lazy at Suspense at S at div at div at dA (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at ep (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at f (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at div at article at h (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at div at D (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at aa (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at ar (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at k (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at c (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at f (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at b (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at b (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at b (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at bP (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at section at div at div at f_ (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at b (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at am (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at aq (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at div at af (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at af (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at bu (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at c (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at bR (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at b (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c… at b9 (https://res.public.onecdn.static.microsoft/files/sp-client/sp-pages-assembly_en-gb_449a0ca4d9d6643c…
SharePoint is now using tabster 8.8.0, so if your WebPart uses anything less than <8.8.0 (in our case we were using 8.7.0) then the page may crash from time to time. This is happens because 8.7.0 initializes first and then when the page needs 8.8.0 it crashes.
Current workaround is to use overrides:
"overrides": {
"tabster": "8.8.0"
}
Be careful not to use >=8.8.1, there might be another issue with inner dependencies, check it here.
// getModalizer.js:
tabsterCore.attrHandlers.set("modalizer", (element, existingModalizer, newProps, oldProps, sys) => {