vitessce-python icon indicating copy to clipboard operation
vitessce-python copied to clipboard

widget fails to load "vitessce-jupyter.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)"

Open lee-t opened this issue 2 years ago • 5 comments

Describe the bug

This was noticed on RStudioConnect which converts all juypter content into html via Nbconvert. The resulting html page does not load vitessce widgets.

More details from the chrome console: DevTools failed to load source map: Could not load content for https://cdn.jsdelivr.net/npm/vitessce-jupyter@%5E0.1.14/dist/index.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE this one is a bit odd because the file at that link is called index.js and not index.js.map

this works: https://cdn.jsdelivr.net/npm/vitessce-jupyter@%5E0.1.14/dist/index.js but this one is what the widget calls for : https://cdn.jsdelivr.net/npm/vitessce-jupyter@%5E0.1.14/dist/index.js.map

To Reproduce Save an ipynb of a vitessce widget. Then convert to html with execution on.

This will result in a mostly empty notebook with the following js console output image.

image

To see an online version: https://ccb.connect.hms.harvard.edu/merfish1/ for whatever reason it cannot find https://ccb.connect.hms.harvard.edu/merfish1/vFLOv47fN/vitessce-jupyter.js

Environment:

  • python 3.7.13
  • pyvitessce 1.0.10
  • Nbconvert 6.4.5

lee-t avatar Oct 18 '22 18:10 lee-t

Hi @lee-t thank you for reporting this issue, I think the are multiple things going on here. I believe the major issue is:

Loading failed for the

The .js.map file issue may be related but .js.map files are just meant for debugging javascript code. The browser requests .map files to be able to show more informative error messages but the failure to load a .map file should not cause the website to crash itself.

I am working on a major Vitessce update at https://github.com/vitessce/vitessce/pull/1333 which should allow us to implement a more comprehensive fix for these notebook issues. I wrote a blog post at http://vitessce-data.s3-website-us-east-1.amazonaws.com/docs/2022-10-13/07cf6970/blog/internal-refactoring/ but in short it will allow us to render Vitessce in plain HTML pages, which will enable us to provide better fallbacks in the notebook context. It is a very large pull request so it still requires more testing before we officially release it and then we will need to update the vitessce-python implementation accordingly

keller-mark avatar Oct 18 '22 18:10 keller-mark

Thanks Mark, thats good news to hear! CCB has been using vitessce for exploring public MERFISH datasets and we were kind of dumbfounded when the RSC hosted notebooks stopped working suddenly. Oddly enough this seems to have affected jupyter notebooks only; VitessceR seems unaffected. The latter however doesn't seem to have genes.json as a recognized file_type so the example in the first post won't migrate property in R. I'll leave this issue up in the meantime until vitessce/vitessce#1333 is pushed.

lee-t avatar Oct 19 '22 18:10 lee-t

Just an update, after installing a new environment with vitessce==3.0.0 a new error message appears: image

lee-t avatar Jan 25 '23 20:01 lee-t

Thanks, is this an error that occurs after converting to HTML using nbconvert? If so then I believe it would still be expected until https://github.com/jupyter/nbconvert/issues/1900 is resolved.

Aside: @manzt in case you have / will be implementing tests/docs for anywidget in different notebook environments, RStudioConnect is another one to keep in mind

keller-mark avatar Jan 25 '23 21:01 keller-mark

Aside: @manzt in case you have / will be implementing tests/docs for anywidget in different notebook environments, RStudioConnect is another one to keep in

Thanks for putting it on my radar. Yes, I'd really like to automate end-to-end tests and explicitly list the known supported environments for anywidget. A primary challenge is that (to my knowledge) I am not aware of how to test nbconvert outputs, VS Code, or Colab until the JS has been published (since they all load the JS from a CDN). Perhaps looking into if there are mechanisms to override the CDN just for anywidget...

manzt avatar Jan 25 '23 21:01 manzt