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

FieldUserRenderer - error on loading Person card (SPHelper -> Cannot read properties of undefined (reading 'getUserById')) #1025

Closed
VladNS90 opened this issue Sep 29, 2021 · 4 comments
Labels
status:fixed-next-drop Issue will be fixed in upcoming release. type:bug

Comments

@VladNS90
Copy link

VladNS90 commented Sep 29, 2021

Category

[x] Bug

Version

Please specify what version of the library you are using: [ 2.9.0 ]

If FieldUserRenderer used for example on a Display form of SharePoint list then Person card fail to load.

Error in console

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getUserById')

I suppose some import is missing in SPHelper file
If I add

import '@pnp/sp/webs';

then issue will not occur.

Also I noticed that sp.web used in other methods of this file and I think it also broken.

I think this should be fixed at least for versions 2.x.x

Thanks!

@ghost
Copy link

ghost commented Sep 29, 2021

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@ghost ghost added the Needs: Triage 🔍 label Sep 29, 2021
@AJIXuMuK
Copy link
Collaborator

AJIXuMuK commented Oct 2, 2021

Hello @VladNS90 - thank you for reporting this issue.
Could you please provide a sample or more detailed instructions on how to repro it?
How did you add a People Picker to the Display form?

Thanks!

@VladNS90
Copy link
Author

VladNS90 commented Oct 2, 2021

Hi @AJIXuMuK. Sorry, my mistake. I used FieldUserRenderer in my Solution. Display form was just an example. Any way it's easy to reproduced with using of FieldUserRenderer. Person card will not load because of missing import in SPHelper class. Suppose this came with migratiob to pnpjs v2. I think it could be easy fix and could help to fix other possible issue with methods in SPHelper. Hope now it's clear. Could this be included in next release of v 2.x.x?

@VladNS90 VladNS90 changed the title PeoplePicker - error on loading Person card (SPHelper -> Cannot read properties of undefined (reading 'getUserById')) FieldUserRenderer - error on loading Person card (SPHelper -> Cannot read properties of undefined (reading 'getUserById')) Oct 2, 2021
gautamdsheth added a commit to gautamdsheth/sp-dev-fx-controls-react that referenced this issue Oct 2, 2021
gautamdsheth added a commit to gautamdsheth/sp-dev-fx-controls-react that referenced this issue Oct 2, 2021
joelfmrodrigues added a commit that referenced this issue Oct 6, 2021
@joelfmrodrigues joelfmrodrigues added status:fixed-next-drop Issue will be fixed in upcoming release. type:bug and removed Needs: Attention 👋 labels Oct 6, 2021
joelfmrodrigues added a commit that referenced this issue Oct 6, 2021
Fix #1025 - issue with missing imports
@AJIXuMuK
Copy link
Collaborator

Fixed as part of v 3.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:fixed-next-drop Issue will be fixed in upcoming release. type:bug
Projects
None yet
Development

No branches or pull requests

3 participants