widgetti / solara

A Pure Python, React-style Framework for Scaling Your Jupyter and Web Apps
https://solara.dev
MIT License
1.9k stars 140 forks source link

Ipyreactplayer not working with solara #333

Open seidlr opened 1 year ago

seidlr commented 1 year ago

I've created an interactive videoplayer using ipyreact and react-player. It works in

To reproduce

git clone https://github.com/seidlr/ipyreactplayer
cd ipyreactplayer
pip install -e .
pip install solara
solara run solara.ipynb

This results in the error:

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'Player')
    at Vimeo.js:108:35

Interestingly voila < 0.5 gave the same error, but in voila >= 0.5 works.

maartenbreddels commented 1 year ago

Hi,

I also cannot get it to work. I wonder if the approach that @kolibril13 suggests in https://github.com/widgetti/ipyreact/issues/45#issuecomment-1774776552 might fix it. It could be that esmodule support is not well functioning in reactplayer in combination with solara. If you get it working that way, lets us know! Still very strange that it does work in voila and normal jupyter.

Regards,

Maarten

seidlr commented 1 year ago

Thanks, I'll have a look. As mentioned the strange thing is that I got the same error as in solara with voila 0.4 but 0.5 somehow fixed it.

maartenbreddels commented 1 year ago

Yeah, that probably gives us a hint. It could be something with requirejs being present in solara and voila < 0.5.