Version conflict in SharePoint with other instances of tabster
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 165
- Forks
- 42
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 9
Description
Since version 8.8.0 a attrHandlers was introduced in Tabster.ts file.
Using Fluent UI 9 in SharePoint may result in tabster crash if different web parts are using different versions of Fluent UI and tabster versions.
Currently SharePoint uses Fluent UI 9 with tabster 8.5.5 dependency. My web part is using latest tabster 8.8.0 and is crashing with this error:
Cannot read properties of undefined (reading 'set')
This code causes this error:
// getModalizer.js:
tabsterCore.attrHandlers.set("modalizer", (element, existingModalizer, newProps, oldProps, sys) => {
^^^
This happens because tabster 8.8.0 instance is not created, instead a 8.5.5 version is used, reusing globally created instace of tabster instead of creating new one. However, anything below 8.8.0 will not have a attrHandlers map which is required in newer versions.
I understand this may sound like an edge case, but in SharePoint different web parts may use different versions of the same library. Even parts of SharePoint itself may use different versions of the same library sometimes.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/Tabster.ts and the attrHandlers access in getModalizer.js. Trace how the globally created Tabster instance is reused when SharePoint web parts load different Tabster versions, then reproduce the mixed-version scenario described in the issue. Done means newer code no longer crashes when it receives an older shared instance lacking attrHandlers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100