I'm having an issue with my website not loading on Safari and getting an error message
SyntaxError: Unexpected identifier 'OpenSeadragon'. import call expects exactly one argument.
This issue only appears to be happening in Safari (seen both on iPhone and iMac) and not an issue on Chrome or Firefox.
When I click on the error message it takes me to a main.min.js
file that was downloaded from cdn.jsdelivr.net
. I'm not an expert in web development so I'm not sure what's wrong with the lines that are highlighted, and also don't know how I'd modify this file anyway, since I don't deliver the file.
These are the relevant lines for how I'm including OpenSeadragon into my website in my index.html
file.
Any help that can be provided would be appreciated.
It looks like you are using ES6 source file instead of output bundle for openseadragon-annotations
npm package.
Chrome and Firefox were smart enough to pick up ES6 module syntax automatically, but you were supposed to use the output bundle file.
According to the Webpack build configuration the output file is dist/openseadragon-annotations.js
.
Try replacing src/main.min.js
with dist/openseadragon-annotations.js
like this:
<script src="https://cdn.jsdelivr.net/npm/openseadragon@2.4/build/openseadragon/openseadragon.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/openseadragon-annotations@1.0.5/dist/openseadragon-annotations.js"></script>