Web Parts not loading for guests on mobile
Table of Contents
So the other day a colleague of mine had what I can only describe as one of the weirdest issues I’ve ever seen in my years of working with SharePoint, so here’s a blog-post with the only purpose being I’ll find it next time I’m having the same issue.
We had an issue where some users were reporting a web part not loading on mobile, oh well might be something with the responsiveness of the web part, just some CSS error, right?
Well, as it turned out, no - they got the “blue text” error, that every SPFx dev will know
Reading the message … wait what? - the user can’t access the SPFx web part assets? - but why? - it works when the same user is on a desktop, and it works for other users on mobile, even our account, so what’s going on?
The issue
It turns out the issue is only happening to guest users, okay, that’s why we can’t reproduce it, let’s get ourselves a guest account and try again.
“Awesome” we can now reproduce the issue, what’s interesting is that it’s also happening on PC if I use the browsers devtools to shrink the window to a mobile size, so it seems to be related to screen size and guest users 🤔
The solution
After some more digging we noticed some 200 OK
request for _layouts/15/AccessDenied.aspx
to the app catalog, and those weren’t there when doing it with desktop layout.
As little sense as this made it turned out that external sharing was disabled on the App Catalog Site Collection, and that the guest were given access via an Entra Security Group, and that group was not given access to the App Catalog Site Collection.
Turns out those permissions are handled differently on mobile vs desktop, and that’s why it was only happening on mobile.
Arguably there’s a bug here, given that the users could access a Web Part that they shouldn’t have access to - but that’s a different story.
TL;DR
Check if you have disabled external access to the app catalog.