Unable to execute SPFx webpart script in mobile view for external users.
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
Windows
What browser(s) / client(s) have you tested
- [ ] 💥 Internet Explorer
- [X] 💥 Microsoft Edge
- [X] 💥 Google Chrome
- [ ] 💥 FireFox
- [ ] 💥 Safari
- [X] mobile (iOS/iPadOS)
- [X] mobile (Android)
- [ ] not applicable
- [ ] other (enter in the "Additional environment details" area below)
Additional environment details
- browser version - Version 120.0.6099.227 (Official Build) (64-bit), 120.0.2210.144 (Official build) (64-bit)
- SPFx version - 5.0.0?
C:\Users\byron> yo --version
5.0.0
- Node.js version - v18.17.1
- Operating system | Windows 11 Version 22H2 (Build 22621.3007)
Describe the bug / error
In the mobile view in Chrome (or Edge) when we visit the site with the SPFx webpart, we receive an error:
The exact same page in the desktop view renders without an issue:
Steps to reproduce
- Used the following command to allow me to grant guest user access to SPFx app.
Connect-SPOService -Url https://[YOUR TENANCY NAME]-admin.sharepoint.com Set-SPOTenant -ShowAllUsersClaim $true - Open Chrome or Edge
- Open the Sharepoint URL that is shared with External users
- Sign into Sharepoint with a guest user account
- Right click on the web page, select Inspect from the context menu
- Click to Toggle device emulation and set to mobile device.
- Navigate to the page that contains the webpart
- Observe the error.
- Click Toggle device emulation button
- Refresh the page in the desktop view
- Observe the webpart execute successfully
Expected behavior
Expect the webpart to render on a mobile device with a guest user account the same way it would for a licensed tenant user.
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Hello there... I have the same problem. Are there any updates since the last entries?
Hi. I'm facing the same problem. Have there been any updates or solutions since the previous discussions? Almost a year of open question...
Got exactly the same error. Any updates?
I found out that opening the page on a mobile device or dev tools with mobile emulation sets a cookie "mobile" to 1. When the cookie is 1 and the browser wants to access the SPFX js file you get an access denied. Without the cookie the access works. Example js file path https://TENANT.sharepoint.com/sites/appcatalog/ClientSideAssets/XXXXXX-XXXXXXX-...../app.js
@deathracr, Could you please confirm if the issue with the SPFx web part not rendering for guest users in mobile view is now resolved? Let me know if it’s still persists.
We are closing this issue for now. If the problem persists, feel free to reopen it or open a new one.