question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't create an OpenSeadragon viewer

See original GitHub issue

Hi 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:closed
  • Created 3 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Mikesteinbergcommented, Jun 8, 2020

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!

0reactions
msalsberycommented, Jul 15, 2020

@Mikesteinberg Glad you got it sorted! Closing this for now…feel free to reopen if the issue persists!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Class: Viewer - OpenSeadragon
To create a viewer, you can use either of this methods: var viewer = new OpenSeadragon. ... A function that gets called if...
Read more >
openseadragon/openseadragon - Gitter
My use case is an OpenSeadragon Viewer in a main panel, and a navigator in a side ... OpenSeadragon can't search the DOM...
Read more >
HTML CSS Cannot See Element OpenSeadragon Viewer
I have tried to make the text as obnoxious as I can so that if it flashes quickly, I can still see it....
Read more >
How to use the openseadragon function in ... - Snyk
BROWSERS, OpenSeaDragon.Browser.vendor) // Create viewer this.viewer = OpenSeaDragon({ element: this. ... we cannot display the open sea dragon'); this.
Read more >
openseadragon-react-viewer - npm
Start using openseadragon-react-viewer in your project by running `npm i openseadragon-react-viewer`. There is 1 other project in the npm ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found