jupyter-widgets / ipyleaflet

A Jupyter - Leaflet.js bridge
https://ipyleaflet.readthedocs.io
MIT License
1.47k stars 361 forks source link

JupyterLite demo errors on ipyleaflet.readthedocs.io #1127

Closed psychemedia closed 8 months ago

psychemedia commented 1 year ago

Trying to run the online demo at https://ipyleaflet.readthedocs.io/en/latest/index.html raises an error.

image
martinRenou commented 1 year ago

We should probably switch to xeus-python in the jupyterlite demo

drf5n commented 11 months ago

This project's main README.md refers from https://github.com/jupyter-widgets/ipyleaflet#documentation directly to the broken https://ipyleaflet.readthedocs.io/en/latest/ page.

If the fix is still in the planning stages, and may continue for another three weeks, at least the https://ipyleaflet.readthedocs.io/en/latest/ front page should have a note or point here to issue https://github.com/jupyter-widgets/ipyleaflet/issues/1127 for status updates.

rdhyee commented 9 months ago

FWIW, I was just trying to learn about ipyleaflet today and saw the error under discussion here. Wondering whether this is an issue that is a good one for someone new to the project to try to fix.

maartenbreddels commented 8 months ago

It has been broken for quite a while, should we remove it? It does not give a good impression now.

drf5n commented 8 months ago

Where is the code that makes that page? Is it near https://github.com/jupyter-widgets/ipyleaflet/blob/master/docs/source/index.rst

This should be a basic use-case for ipyleaflet and should be repaired rather than removed.

martinRenou commented 8 months ago

It should be more stable now

drf5n commented 8 months ago

I get this after a click and two shift-returns:

image

...or in text form:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
File /lib/python3.10/site-packages/IPython/__init__.py:44, in patch_asyncio.<locals>.asyncio_call(self, coro)
     41     task.add_done_callback(done_cb)
     43 raw_js_py_callback = pyjs.JsValue(py_callback)
---> 44 js_py_callback = raw_js_py_callback['__usafe_void_val_val__'].bind(raw_js_py_callback)
     45 js_promise = pyjs.js.Promise.new(js_py_callback)
     47 pyjs.js.globalThis.toplevel_promise = js_promise

AttributeError: has no attribute/key 
martinRenou commented 8 months ago

You're hitting some caching. Can you try opening the documentation page from a private window?

The Notebook should now use the jupyterlite-xeus-python kernel which does not provide piplite. ipyleaflet should be pre-installed in this kernel.

rdhyee commented 8 months ago

I can confirm that when I go to https://ipyleaflet.readthedocs.io/en/latest/index.html in a private window, the demo is now working for me.

martinRenou commented 8 months ago

Nice!

Browser caching is known to go in your way when using JupyterLite. Cleaning all data for that webpage or opening from a private windows should prevent that.