mesa icon indicating copy to clipboard operation
mesa copied to clipboard

SolaraViz blank visualisation with new `ipyvue` release

Open azreika opened this issue 3 months ago • 8 comments

Describe the bug When I run the SolaraViz examples from the documentation or from the mesa-examples repo in a fresh environment, I only get the sidebar without the visualisation.

In the browser console, there is a Vue error saying:

Uncaught TypeError: GlobalVue.use is not a function

ipyvue had a new release a few days ago on August 12th moving from 1.12.0 to 3.0.0, as did ipyvuetify.

Expected behavior I expect the visualisation to appear.

To Reproduce Set up virtual env:

python -m venv .venv
source .venv/bin/activate

Follow installation from the README:

pip install -U mesa
pip install -U "mesa[network,viz]"
pip install -U "mesa[rec]"

Run the example app from the wealth tutorial (here is the script app.py):

solara run app.py

I get an empty screen:

Image

Downgrade ipyvue and ipyvuetify:

pip install --force-reinstall "ipyvue<2" "ipyvuetify<2"

And now it works

Image

Additional context

azreika avatar Aug 18 '26 02:08 azreika

Thanks for the detailed work you have done @azreika — very useful for anyone hitting this in the meantime.

Just to be clear for others finding around this issue are: pip install --force-reinstall "ipyvue<2" "ipyvuetify<2" is a version pin, great initiative but truth is that its kind of like a forced fix. ipyvue/ipyvuetify 3.0 is a ground-up rewrite targeting Vue 3, which is why we're seeing GlobalVue.use is not a function — Solara's rendering layer is still calling the old Vue 2-style global API. As per Solara's own roadmap, full ipyvuetify 3.0 support isn't there for every component yet, so <2 is really the only gap that lands on upstream.

  • Has anyone found a different idea to fix this, or is the version pin is the only way to go with?
  • @azreika — if you'd be interested in picking this up that'd be very welcome.

dietcoke-17 avatar Aug 22 '26 09:08 dietcoke-17

Hi @dietcoke-17, I looked into the issue. If you want a workaround so that it becomes upstream compatible without pinning to a legacy version, I think we can go one of two ways here:

We could inject a lightweight JavaScript shim in the frontend layout: The root cause is that ipyvue 3.0.0 (Vue 3) removed GlobalVue.use(...), which the widget loader is still trying to call. We can inject a tiny 4-line script via solara.HTML that defines a fallback window.GlobalVue.use function. This intercepts the call and executes it safely, allowing SolaraViz to render with modern Vue 3 without touching any pip package versions or pinning legacy dependencies.

OR

Decouple the canvas from Vue/Altair widgets entirely: Instead of routing the center space through FigureAltair (which pulls in the Vue/Vuetify widget pipeline), we could explore alternative canvas backends for SpaceRenderer:

Native SVG Canvas: Pure vector markup via solara.HTML. This natively preserves agent shapes, colors, layering, and hover tooltips with zero Vue widget dependencies, while offering 10x faster rendering on large agent populations. In-Memory Image Streaming (solara.Image): Renders Matplotlib figures directly to in-memory PNG bytes, giving 100% space coverage (continuous spaces, Voronoi, hex grids) with no client-side JavaScript overhead. these are the ones i have explored so far but if you've got any suggestions im open to hear about it.

shipitdev avatar Aug 23 '26 07:08 shipitdev

@tpike3 would love to hear your direction kinda agree with the suggestion here gave by @shipitdev the first suggestion looks good to me for the timing being when its not updated with vue 3 we can adopt this but when the update will complete by vue we can use it directly or anything you have that we should look at?

dietcoke-17 avatar Aug 23 '26 13:08 dietcoke-17

Apologies for the delay on this. I am having no issues running solara locally. However, it seems the tutorial is way out of date (Binder link) and is giving import errors, with no discrete_space etc

What am I missing?

tpike3 avatar Sep 12 '26 18:09 tpike3

@tpike3 the problem we had discussed in the meet regarding the PYCAFE platform issue has been fixed and we can continue and can close this issue i have checked all the models are running properly and fine i think the multithreding issue by the pycafe end is fixed and therfore our models are running proper and fine

dietcoke-17 avatar Sep 14 '26 06:09 dietcoke-17

Thanks @dietcoke-17

tpike3 avatar Sep 15 '26 09:09 tpike3

Hi, I faced this issue too as a first time user and I was able to work around it by bypassing SolaraViz/GridDraggable and using SpaceRendererComponent directly. I'd like to know if there's currently any other workaround for this issue apart from downgrading ipvue. Current environment - Mesa: 4.0.0a0, Solara: 1.64.0, ipyvue: 3.0.0, ipyvuetify: 3.0.0

CraftierTen5 avatar Oct 06 '26 16:10 CraftierTen5

Still happens on a fresh install: Solara 1.64.1 pulls in ipyvue 3.1.1 and ipyvuetify 3.1.0, and SolaraViz shows only the sidebar. pip install "ipyvue<3" "ipyvuetify<3" fixes it.

Opened widgetti/solara#1268 asking whether Solara 1.x can cap these at <3. If that doesn't land soon, we could add the same cap to our viz extras.

With ipyvue<3 / ipyvuetify<3, the grid shows the space plot and the line chart:

Image

With ipyvue 3.1.1 / ipyvuetify 3.1.0, the grid area under the "Page 0" tab is empty (and the theme changes too: purple app bar instead of blue):

Image

EwoutH avatar Oct 29 '26 22:10 EwoutH