mistic100 / Photo-Sphere-Viewer

A JavaScript library to display 360° sphere panoramas.
https://photo-sphere-viewer.js.org
MIT License
1.8k stars 645 forks source link

iOS 16.2 module reference error on page load (import maps polyfill fix SOLVED) #1315

Closed jywarren closed 1 month ago

jywarren commented 1 month ago

Describe the bug

On just one of 3 iOS devices, I encountered this error:

TypeError: Module specifier, '@photo-sphere-viewer/core' does not start with "/", "./", or "../". Referenced from https://photo-sphere-viewer.js.org/demos/basic/0-config.html

This was unexpected as I had no trouble loading demos or my own code on close to 70 iPhones recently. I will look for other instances of this kind of error on iOS 16.2, perhaps it's a known issue and can by bypassed by updating the OS?

Online demo URL

https://photo-sphere-viewer.js.org/demos/basic/0-config.html

Photo Sphere Viewer version

5.7.4

Plugins loaded

No response

OS & browser

iOS 16.2 Safari

Additional context

No response

jywarren commented 1 month ago

Indeed Safari got import maps support in v16.4: https://caniuse.com/import-maps

Will try https://github.com/guybedford/es-module-shims

jywarren commented 1 month ago

That fixed it! Just include this line in your <head> tags:

<script async src="https://ga.jspm.io/npm:es-module-shims@1.10.0/dist/es-module-shims.js"></script>