ipyleaflet icon indicating copy to clipboard operation
ipyleaflet copied to clipboard

Map doesn't show in JupyterLite

Open davidbrochart opened this issue 3 years ago • 5 comments

When browsing to https://ipyleaflet.readthedocs.io/en/latest: image

davidbrochart avatar Jul 12 '22 07:07 davidbrochart

It works in https://jupyterlite.readthedocs.io/en/latest/_static/lab, but it has ipyleaflet v0.16: image

davidbrochart avatar Jul 12 '22 07:07 davidbrochart

It's probably because the deployed version pulled 0.16 at build time for the frontend extension.

And now calling piplite.install('ipyleaflet') pulls 0.17 from PyPI, but the frontend assets are still the same (0.16).

There are multiple ways of solving this. Either by pinning the version with piplite.install('ipyleaflet==0.17') in the notebook and making sure to update it on new releases.

Or use an approach like in the ipywidgets repo with piplite_urls: https://github.com/jupyter-widgets/ipywidgets/blob/master/docs/source/jupyter_lite_config.json

Or switch to the jupyterlite-xeus-python kernel and also make sure the version are pinned or at least in sync.

jtpio avatar Jul 20 '22 07:07 jtpio

The first solution is implemented in https://github.com/jupyter-widgets/ipyleaflet/pull/1040.

HaudinFlorence avatar Aug 17 '22 15:08 HaudinFlorence

Or use an approach like in the ipywidgets repo with piplite_urls: https://github.com/jupyter-widgets/ipywidgets/blob/master/docs/source/jupyter_lite_config.json

One really nice thing about this approach is that it works for master as well, in that it bundles exactly the version of ipyleaflet the repo is currently at, so you can immediately test the current state of master.

Note that in addition to the jupyter_lite_config.json part, you also need to build the dev version of the packages when building docs: https://github.com/jupyter-widgets/ipywidgets/blob/58adde2cfbe2f78a8ec6756d38a7c637f5e599f8/docs/source/conf.py#L151-L171

jasongrout avatar Aug 20 '22 13:08 jasongrout

I would be happy to make this fix with the piplite_urls. I have been having a look but I haven't managed to fully transpose the logics shown for ipywidgets repo to the case of ipyleaflet.

HaudinFlorence avatar Sep 01 '22 10:09 HaudinFlorence