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

[BUG] The latest versions of mgt package don't work properly with SharePoint #3403

Closed
s-KaiNet opened this issue Feb 17, 2025 · 2 comments · Fixed by #3424
Closed

[BUG] The latest versions of mgt package don't work properly with SharePoint #3403

s-KaiNet opened this issue Feb 17, 2025 · 2 comments · Fixed by #3424
Assignees
Labels

Comments

@s-KaiNet
Copy link
Contributor

s-KaiNet commented Feb 17, 2025

Describe the bug
You cannot use the latest versions of mgt components with the latest SPFx.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new SPFx web part (current SPFx is 1.20)
  2. Install the latest version of mgt packages (4.4.0) to the SPFx solution (npm i @microsoft/mgt-components@4.4.0 @microsoft/mgt-element@4.4.0 @microsoft/mgt-react@4.4.0 @microsoft/mgt-sharepoint-provider@4.4.0 @microsoft/mgt-spfx-utils@4.4.0 -SE)
  3. Initialize the web part with some initial code. You can use code from the sample repository (component and web part). But you should scaffold a new web part from scratch, because the sample in the mentioned repo is a bit outdated (also package-lock.json installs older versions of packages, which we should avoid) and might not work as expected if you try to use it directly.
  4. Run gulp serve and add web part to a page - you will see below error:

Image

Which is actually

"Cannot find manifest for 32b9363b-09ff-4959-929a-cab2663fb223_3.0.7. Store had [3.0.2]. Service worker version: (none); App version: (unknown); Next app version: (unknown)"

Expected behavior
No errors, the web part renders mgt related components.

Additional information
The issue seems related to the fact, that SharePoint supports only 3.0.2 version of "@microsoft/microsoft-graph-client.
SPFx packages normally depend on 3.0.2 version:

Image

Mgt packages starting from version 4.3.0 have dependency on "@microsoft/microsoft-graph-client of version 3.0.7 where the issues are. In contrast, the 4.2.5 version depends on 3.0.2 and works fine.

@s-KaiNet
Copy link
Contributor Author

s-KaiNet commented Feb 17, 2025

If anybody looking for a workaround, you can try npm i @microsoft/microsoft-graph-client@3.0.2 -SE in your SPFx solution, which should fix the problem. However, it's not good as a long term solution.

@Mnickii Mnickii self-assigned this Mar 13, 2025
@Mnickii
Copy link
Collaborator

Mnickii commented Mar 13, 2025

Thank you for raising this issue. We will revert to using "@microsoft/microsoft-graph-client" version 3.0.2. This will be available in our next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done ✔️
2 participants