sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Unable to execute SPFx webpart script in mobile view for external users.

Open deathracr opened this issue 1 year ago • 2 comments

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: image

The exact same page in the desktop view renders without an issue: image

Steps to reproduce

  1. 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
  2. Open Chrome or Edge
  3. Open the Sharepoint URL that is shared with External users
  4. Sign into Sharepoint with a guest user account
  5. Right click on the web page, select Inspect from the context menu
  6. Click to Toggle device emulation and set to mobile device.
  7. Navigate to the page that contains the webpart
  8. Observe the error.
  9. Click Toggle device emulation button
  10. Refresh the page in the desktop view
  11. 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.

deathracr avatar Jan 30 '24 15:01 deathracr

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

ghost avatar Jan 30 '24 15:01 ghost

Hello there... I have the same problem. Are there any updates since the last entries?

Lord-Vendreth avatar Jul 01 '24 09:07 Lord-Vendreth

Hi. I'm facing the same problem. Have there been any updates or solutions since the previous discussions? Almost a year of open question...

petrovi422 avatar Dec 09 '24 08:12 petrovi422

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

Demonofpower avatar Feb 17 '25 19:02 Demonofpower

@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.

Ashlesha-MSFT avatar Jul 02 '25 06:07 Ashlesha-MSFT

We are closing this issue for now. If the problem persists, feel free to reopen it or open a new one.

Ashlesha-MSFT avatar Jul 08 '25 13:07 Ashlesha-MSFT