SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.24k stars 994 forks source link

Webpart throwing error on mobile/in mobile emulation #9750

Open sliziky opened 1 month ago

sliziky commented 1 month ago

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

Additional environment details

Describe the bug / error

I have built an SPFx package containing 1 form webpart and deployed it into Sharepoint A (site collection app catalog) and Sharepoint B (global app catalog):

ERROR:
Script error for: f3a9abfa-9d4a-457a-88dc-07b89b53bf8a_0.0.1/ControlStrings
http://requirejs.org/docs/errors.html#scripterror

CALL STACK:
Error: Script error for: f3a9abfa-9d4a-457a-88dc-07b89b53bf8a_0.0.1/ControlStrings
http://requirejs.org/docs/errors.html#scripterror
    at B (eval at e (https://res-1.cdn.office.net/files/sp-client/sp-pages-assembly_cs-cz_c113e52d950edbc28a80ec2e906317e2.js:198:10340), <anonymous>:8:252)
    at HTMLScriptElement.onScriptError (eval at e (https://res-1.cdn.office.net/files/sp-client/sp-pages-assembly_cs-cz_c113e52d950edbc28a80ec2e906317e2.js:198:10340), <anonymous>:30:244)

and also this Console error:

Could not load form-web-part in require. Error: Script error for: f3a9abfa-9d4a-457a-88dc-07b89b53bf8a_0.0.1/ControlStrings
http://requirejs.org/docs/errors.html#scripterror
    at B (eval at e (sp-pages-assembly_cs-cz_c113e52d950edbc28a80ec2e906317e2.js:198:10340), <anonymous>:8:252)
    at HTMLScriptElement.onScriptError (eval at e (sp-pages-assembly_cs-cz_c113e52d950edbc28a80ec2e906317e2.js:198:10340), <anonymous>:30:244)

as soon as I cancel emulation and do refresh, the error is gone.

I have also tried with SPFx 1.18.2 and 1.12.1 but happens all the time. Could there be any problem with Sharepoint settings? Catalog?

Thanks

Steps to reproduce

  1. Deployed SPFx package and added it into site
  2. Added webpart into sitepage
  3. Webpart throws error in mobule emulation

Expected behavior

I expect Sharepoint to render webpart in mobule emulation

sliziky commented 4 weeks ago

UPDATE - We have tested the solution on multiple browsers on Android and the only one that works is Firefox - Edge/Chrome/Opera crash.