jupyter-widgets-contrib / ipycanvas

Interactive Canvas in Jupyter
https://ipycanvas.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
685 stars 62 forks source link

voila fails to load ipycanvas.js from localhost #307

Closed tongda closed 1 year ago

tongda commented 1 year ago

Lib versions: voila: 0.4.0 ipywidgets: 8.0.2 ipycanvas: 0.13.1

When rendering .ipynb with voila, in browser console, there is always an error as follows:

require.min.js:1          GET http://10.168.1.150:8800/voila/ipycanvas.js net::ERR_ABORTED 404 (Not Found)
Falling back to https://cdn.jsdelivr.net/npm/ for ipycanvas@^0.13

How can I work around this and let voila load ipycanvas js from local instead of CDN?

martinRenou commented 1 year ago

You need to use the --enable_nbextensions=True option for Voila.

You should know that there are some limitations in Voila: https://ipycanvas.readthedocs.io/en/latest/advanced.html#ipycanvas-in-voila

tongda commented 1 year ago

Thanks.

You need to use the --enable_nbextensions=True option for Voila.

This solve the problem and console log with Loaded classic notebook extension "ipycanvas/extension".. Great.

You should know that there are some limitations in Voila: https://ipycanvas.readthedocs.io/en/latest/advanced.html#ipycanvas-in-voila

Well... I've already encountered the problem. I did not notice that chapter at first.