Can't create an OpenSeadragon viewer
See original GitHub issueHi guys, I’m pretty new to Javascript and have been trying to avoid it as much as possible, but I need to add a OSG viewer to a Flask site. I have the dzi created successfully and I thought I was basically done when I realized that I simply could not get around this error. I’m using the sample block of code from the documentation:
<div id="openseadragon1" style="width: 955px; height: 693px;"></div>
<script src="/static/openseadragon/build/openseadragon/openseadragon.min.js"></script>
<script type="text/javascript">
var viewer = OpenSeadragon({
id: "openseadragon1",
prefixUrl: "/openseadragon/images/",
tileSources: "/repos/analysis/output/img.dzi",
});
</script>
Every time I run this I get nailed with an “Uncaught ReferenceError: OpenSeadragon is not defined”
Further investigation shows that the script source is apparently not being found, “Failed to load resource: the server responded with a status of 404 ()”
I’m pretty sure I installed the OSG package properly with npm but I can’t be sure. I installed it under the Flask static folder which I believe is correct but I almost never use Javascript or flask so I wouldn’t know.
I suspect that the source path for the js function might be incorrect but I have tried a bunch of different ones with very little changes in results.
Does anyone have any idea what is wrong here? Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (6 by maintainers)
Top GitHub Comments
Thanks again, I managed to sidestep the issue using the CDN version instead of npm. Likely has to do with an issue with the proxy. It’s now working!
@Mikesteinberg Glad you got it sorted! Closing this for now…feel free to reopen if the issue persists!