4.1.0 chunk load error on iOS Safari
Basic information
MapillaryJS version: 4.1.0
System/Browser: Safari Mobile
Steps to Reproduce Behavior
- Install mapillary-js package 4.1.0 to project with angular version 11.2.14.
- Create production build and run the app on iOS Safari.
- 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!
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?
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?
yes, buildOptimizer=false is fixing the issue for angular versions below 12 as mentioned in the link
@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.