sp-dev-fx-webparts icon indicating copy to clipboard operation
sp-dev-fx-webparts copied to clipboard

react-follow-document - Web part loading forever and JS error in the console

Open Maya-Mostafa opened this issue 2 years ago • 7 comments

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

  1. Unfavorite all your documents
  2. Reload the page holding the web part
  3. 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

Maya-Mostafa avatar May 06 '22 18:05 Maya-Mostafa

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

ghost avatar May 06 '22 18:05 ghost

@Maya-Mostafa thank you for reporting will give a look.

aaclage avatar May 06 '22 18:05 aaclage

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

nofavorites

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.

Maya-Mostafa avatar May 13 '22 16:05 Maya-Mostafa

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

aaclage avatar May 13 '22 16:05 aaclage

Sure, I will submit a PR :)

Maya-Mostafa avatar May 16 '22 16:05 Maya-Mostafa

@Maya-Mostafa

And thank you helping the community and for improving with this new great features/corrections :)

Great contribution.

aaclage avatar May 24 '22 15:05 aaclage