question

vikrambhardwaj-2093 avatar image
0 Votes"
vikrambhardwaj-2093 asked sajithgh commented

Spfx 2019 pnp/spfx-controls-react

47373-spfx-2019.png


Hi team

i have worked sharfepoint 2019,i had npm install @pnp/spfx-controls-react --save --save-exact in spfx project.then come error in Error - typescript - node_modules/@pnp/sp/appcatalog/types.d.ts(29,33): error TS1110: Type expected..what will be do in spfx react pnp controll. what is issue then tell


windows-server-2016office-sharepoint-server-customization
spfx-2019.png (120.4 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @vikrambhardwaj-2093,

Is there anything update? Did installing the @pnp/spfx-controls-react V1 work for you?

If my answer helps you, please click "Accept Answer" and upvote it.

0 Votes 0 ·

yes it work but when install
npm install @pnp/logging @pnp/common @pnp/odata @pnp/sp --save
did not work in sharepoint 2019

0 Votes 0 ·

Hi @vikrambhardwaj-2093,

You could refer to this article: https://pnp.github.io/pnpjs/SPFx-on-premises/

Just run the command npm install would work for you.


0 Votes 0 ·

Hi,

Since this worked for you, please accept my answer. It would be helpful to others who have similar issues in the future.

0 Votes 0 ·
MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered

Hi @vikrambhardwaj-2093,

Per my test, the people picker works on my end.

Install @pnp/spfx-controls-react v1 as I mentioned:


 npm i @pnp/spfx-controls-react@1.19.0

You could check the version of @pnp/spfx-controls-react in package.json file:

49907-image.png

Import the following modules to your component:

 import { PeoplePicker, PrincipalType } from "@pnp/spfx-controls-react/lib/PeoplePicker";

Use the PeoplePicker control in your code as follows:

      <PeoplePicker
       context={this.props.context}
       titleText="People Picker"
       personSelectionLimit={3}
       showtooltip={true}
       isRequired={true}              

       showHiddenInUI={false}
       principalTypes={[PrincipalType.User]}
       resolveDelay={1000} />


49837-image.png

Test result:

49914-image.png



image.png (66.2 KiB)
image.png (70.8 KiB)
image.png (37.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered sajithgh commented

Hi @vikrambhardwaj-2093,

Per my test, I could reproduce your issue on my end. This due to the version of @pnp/spfx-controls is not supported in SharePoint 2019 framework.

In fact, the command npm install @pnp/spfx-controls-react --save --save-exact will install the latest version @pnp/spfx-controls-react V2. V2 Supports SharePoint Online only. We have to use v1 to deploy solutions on SharePoint 2019 : https://pnp.github.io/sp-dev-fx-controls-react/guides/migrate-from-v1/

To install @pnp/spfx-controls-react v1, you could use this command instead:

 npm i @pnp/spfx-controls-react@1.19.0

Reference: https://www.npmjs.com/package/@pnp/spfx-controls-react/v/1.19.0


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.




· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@MichaelHan-MSFT thank you Michael really appreciate your reply but people picker not working in my case am I missing anything ? and I am not able to deploy in SharePoint 2019 on premise can you please help.

0 Votes 0 ·
sajithgh avatar image sajithgh vikrambhardwaj-2093 ·

I am getting this issue

https://docs.microsoft.com/en-us/answers/questions/487519/spfx-2019-pnpsp-issue.html

Which version of @pnp/sp are you using ?

0 Votes 0 ·