Skip to content

PeoplePicker not compatible with SharePoint 1.19? #1859

@EA12

Description

@EA12

Category

[ ] Enhancement

[x ] Bug

[ ] Question

Version

@pnp/spfx-controls-react": "^3.18.1

Expected / Desired Behavior / Question

It should be possible to assign the context to the PeoplePicker like described in the documentation:
const peoplePickerContext: IPeoplePickerContext = { absoluteUrl: props.ctx.pageContext.web.absoluteUrl, msGraphClientFactory: props.ctx.msGraphClientFactory, spHttpClient: props.ctx.spHttpClient };

Observed Behavior

I get this message:
Type 'import("c:/Projekte/SPFx/AM/node_modules/@microsoft/sp-http-msgraph/dist/index-internal").MSGraphClientFactory' is not assignable to type 'import("c:/Projekte/SPFx/AM/node_modules/@pnp/spfx-controls-react/node_modules/@microsoft/sp-http-msgraph/dist/index-internal").MSGraphClientFactory'.
Types have separate declarations of a private property '_serviceScope'.ts(2322)
IPeoplePickerContext.d.ts(13, 5): The expected type comes from property 'msGraphClientFactory' which is declared here on type 'IPeoplePickerContext'
(property) IPeoplePickerContext.msGraphClientFactory: MSGraphClientFactory

Steps to Reproduce

Create a new SPFx-Solution (WebPart with React) and install the latest @pnp/spfx-controls-react which is currently "3.18.1"
Impelement a PeoplePicker like described in your documentation: https://pnp.github.io/sp-dev-fx-controls-react/controls/PeoplePicker/

If you verify sp-http-msgraph with
npm list @microsoft/sp-http-msgraph
you will see this:

├── @microsoft/sp-http-msgraph@1.19.0 ├─┬ @microsoft/sp-http@1.19.0 │ └── @microsoft/sp-http-msgraph@1.19.0 deduped └─┬ @pnp/spfx-controls-react@3.18.1 ├─┬ @microsoft/sp-adaptive-card-extension-base@1.18.2 │ └─┬ @microsoft/sp-http@1.18.2 │ └── @microsoft/sp-http-msgraph@1.18.2 ├─┬ @microsoft/sp-dialog@1.18.2 │ └─┬ @microsoft/sp-application-base@1.18.2 │ └─┬ @microsoft/sp-http@1.18.2 │ └── @microsoft/sp-http-msgraph@1.18.2

From my package.json:

"dependencies": { "@fluentui/react": "8.106.4", "@microsoft/sp-core-library": "1.19.0", "@microsoft/sp-lodash-subset": "1.19.0", "@microsoft/sp-office-ui-fabric-core": "1.19.0", "@microsoft/sp-property-pane": "1.19.0", "@microsoft/sp-webpart-base": "1.19.0", "@microsoft/sp-http": "1.19.0", "@microsoft/sp-http-msgraph": "1.19.0", "@pnp/sp": "^4.3.0", "@pnp/spfx-controls-react": "^3.18.1", ...

So it seems that "@pnp/spfx-controls-react@3.18.1" is using @microsoft/sp-http@1.18.2 and not version "1.19.0"
Can bring bring some light on this?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions