sp-dev-fx-webparts
sp-dev-fx-webparts copied to clipboard
react-follow-document - Web part loading forever and JS error in the console
Disclaimer
Yes
Sample
react-follow-document
Author(s)
@aaclage
What happened?
When the user doesn't have followed documents, to begin with, the web part keeps loading forever and there is a script error appears in the console. Once there are followed documents, it works fine.
Steps to reproduce
- Unfavorite all your documents
- Reload the page holding the web part
- Loading forever with an error in the console.
Expected behavior
There should be a notification message appearing informing the user that there are no-followed items, instead of the infinite preloader.
Target SharePoint environment
SharePoint Online
Developer environment
Windows
Browsers
- [ ] Internet Explorer
- [ ] Microsoft Edge
- [X] Google Chrome
- [ ] FireFox
- [ ] Safari
- [ ] mobile (iOS/iPadOS)
- [ ] mobile (Android)
- [ ] not applicable
- [ ] other (enter in the "Additional environment details" area below)
Paste the results of SPFx doctor
CLI for Microsoft 365 SharePoint Framework doctor Verifying configuration of your system for working with the SharePoint Framework
√ SharePoint Framework v1.12.1 √ Node v12.22.10 √ yo v3.1.1 √ gulp v4.0.2 √ bundled typescript used
Additional environment details
No response
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
@Maya-Mostafa thank you for reporting will give a look.
Hi, I managed to change a little bit in the code to get this issue fixed. Please find below gist links for the updated files. I used the same look and feel for the Microsoft Office message for the "No favorites".
Changes in line: 76 & 449 FollowDocumentWebPart.tsx
Changes in line 41 FollowDocumentWebPart.module.scss
Thanks for implementing this web part!
Note- There is another issue I found related to failing to display favorited documents that are not part of a shared document library. I will log another issue with it.
Hi @Maya-Mostafa,
You are free to include the fixes/improve in spfx dev webparts repo, this is open to the community :) i only started the webpart
Sure, I will submit a PR :)
PR submitted last week https://github.com/pnp/sp-dev-fx-webparts/pull/2706
@Maya-Mostafa
And thank you helping the community and for improving with this new great features/corrections :)
Great contribution.