Skip to content

Unmet peer dependency: @microsoft/microsoft-graph-client@3.0.2 required but 1.7.2-spfx is installed #75

@nick-pape

Description

@nick-pape

Summary

rush update reports an unmet peer dependency for @microsoft/microsoft-graph-client. The package @microsoft/sp-http-msgraph@1.22.2 declares a peer dependency on @microsoft/microsoft-graph-client@3.0.2, but the version actually resolved is 1.7.2-spfx (a custom SPFx-specific fork).

Root Cause

The dependency chain is:

  1. Example projects depend on SPFx packages like @microsoft/sp-component-base@1.22.2, @microsoft/sp-extension-base@1.22.2, etc.
  2. These transitively depend on @microsoft/sp-http@1.22.2
  3. @microsoft/sp-http@1.22.2 depends on @microsoft/sp-http-msgraph@1.22.2
  4. @microsoft/sp-http-msgraph@1.22.2 declares peerDependencies: { "@microsoft/microsoft-graph-client": "3.0.2" }
  5. The resolved version is @microsoft/microsoft-graph-client@1.7.2-spfx (an internal SPFx version), which does not satisfy 3.0.2

Affected Examples

Nearly all examples, since most depend on SPFx packages that transitively pull in @microsoft/sp-http-msgraph:

  • examples/extension-fieldcustomizer-*
  • examples/extension-formcustomizer-*
  • examples/extension-listviewcommandset
  • examples/extension-search-query-modifier
  • examples/ace-data-visualization
  • And others

pnpm Warning

../../examples/extension-listviewcommandset
├─┬ @microsoft/sp-listview-extensibility 1.22.2
│ └─┬ @microsoft/sp-extension-base 1.22.2
│   └─┬ @microsoft/sp-component-base 1.22.2
│     └─┬ @microsoft/sp-http 1.22.2
│       └─┬ @microsoft/sp-http-msgraph 1.22.2
│         └── ✕ unmet peer @microsoft/microsoft-graph-client@3.0.2: found 1.7.2-spfx

Notes

This appears to be a version mismatch within Microsoft's own SPFx packages. @microsoft/sp-http-msgraph declares a peer dependency on the standard @microsoft/microsoft-graph-client@3.0.2, but the SPFx runtime bundles a custom forked version (1.7.2-spfx). The peer dependency declaration may need to be updated to reflect the actual version used.

The workaround is to suppress this via globalPeerDependencyRules in pnpm-config.json.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions