mapillary-js icon indicating copy to clipboard operation
mapillary-js copied to clipboard

4.1.0 chunk load error on iOS Safari

Open pavch opened this issue 3 years ago • 4 comments

Basic information

MapillaryJS version: 4.1.0 System/Browser: Safari Mobile

Steps to Reproduce Behavior

  1. Install mapillary-js package 4.1.0 to project with angular version 11.2.14.
  2. Create production build and run the app on iOS Safari.
  3. We are observing the following error: ERROR ERROR Error: Uncaught (in promise): ChunkLoadError: Loading chunk 4 failed. The error is reproducable with clean cache on Safari. Removing mapillary and readding it with version 4.0.0 is fixing the issue. Readding mapillary-js 4.1.0 is showing the same error again, so our team is assuming this is not related to the common chunk errors, caused by wrongly cached files. Could you help us identify what in mapillary can cause such behaviour?

Thank you!

pavch avatar Jun 28 '22 11:06 pavch

The MapillaryJS version 4.1.0 bundle works standalone on iOS.

I am unfamiliar with Angular. How does the Angular production build affect the inner code structure of dependencies?

oscarlorentzon avatar Jul 07 '22 19:07 oscarlorentzon

Some three.js versions seems to cause issues in Safari: https://github.com/angular/angular-cli/issues/21107 https://stackoverflow.com/questions/68224800/left-hand-side-of-operator-must-be-a-reference-only-in-webkit-safari-in-ang

Maybe this is related?

sandromartis avatar Sep 30 '22 09:09 sandromartis

yes, buildOptimizer=false is fixing the issue for angular versions below 12 as mentioned in the link

pavch avatar Sep 30 '22 15:09 pavch

@sandromartis @pavch Thanks for providing additional information and workaround. For the next MJS version we will ensure that three.js is upgraded to the latest version. Hopefully the Angular build optimization can be used again then.

oscarlorentzon avatar Nov 04 '22 16:11 oscarlorentzon