-
-
Notifications
You must be signed in to change notification settings - Fork 531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PyScript reference example no longer working #6995
Comments
Does not work with latest versions of PyscriptIf I try to use the latest versions from https://docs.pyscript.net/2024.7.1/beginning-pyscript/ nothing is shown. <!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-3.4.1.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.4.1.min.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-tables-3.4.1.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@holoviz/panel@1.4.4/dist/panel.min.js"></script>
<link rel="stylesheet" href="https://pyscript.net/releases/2024.7.1/core.css">
<script type="module" src="https://pyscript.net/releases/2024.7.1/core.js"></script>
</head>
<body>
<py-config>
packages = [
"https://cdn.holoviz.org/panel/1.4.4/dist/wheels/bokeh-3.4.1-py3-none-any.whl",
"https://cdn.holoviz.org/panel/1.4.4/dist/wheels/panel-1.4.4-py3-none-any.whl"
]
</py-config>
<div id="simple_app"></div>
<py-script>
import panel as pn
pn.extension(sizing_mode="stretch_width")
slider = pn.widgets.FloatSlider(start=0, end=10, name='Amplitude')
def callback(new):
return f'Amplitude is: {new}'
pn.Row(slider, pn.bind(callback, slider)).servable(target='simple_app');
</py-script>
</body>
</html> |
I have a dejavu ... are you using also latest bokeh JS version or that part is the old one so that code in Python can't communicate with it? 🤔 'cause we already had that issue and also solved it in our examples https://pyscript.com/@examples/simple-panel/latest |
to clarify, the issue with our examples was the missing pinned version around pyscript and bokeh ... I think we recently solved that with latest too ... I need to double check though |
The reference example https://pyscript.com/@examples/simple-panel/latest you are linking to is using a very old version of pyscript (with the speed pyscript is moving) and an old version of Panel. I'm using the latest Panel version 1.4.4 together with the recommended bokeh version 3.4.1. See https://panel.holoviz.org/how_to/wasm/standalone.html#pyscript |
Just to make sure Panel 1.4.4 and Bokeh 3.4.1 can work with Pyodide, I tried the Pyodide reference example at https://panel.holoviz.org/how_to/wasm/standalone.html#pyodide. And it works. |
Thanks for the pointer ... I can confirm something is off with our custom <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>🦜 Panel Editor Template</title>
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-3.4.1.js"></script>
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.4.1.min.js"></script>
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-tables-3.4.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@holoviz/panel@1.4.4/dist/panel.min.js"></script>
<script type="module" src="https://pyscript.net/releases/2024.7.1/core.js"></script>
</head>
<body>
<div id="simple_app"></div>
<script type="pyodide" config="./config.toml">
import panel as pn
pn.extension(sizing_mode="stretch_width")
slider = pn.widgets.FloatSlider(start=0, end=10, name='Amplitude')
def callback(new):
return f'Amplitude is: {new}'
pn.Row(slider, pn.bind(callback, slider)).servable(target='simple_app')
</script>
</body>
</html> I will investigate and fix this tomorrow morning, first thing 👍 |
The above was using VS Code live server. If I use |
yeah but that's not the issue, it's just your Service Worker still running behind the scene ... go in devtools Application panel, unregister, then go storage, clear all data, then try again without |
we found the culprit of the issue and it looks like it's in your code, as explained in here: That MR made me suffer a lot to find the culprit of the issue which was our "internal" What I see in your code is that you are screaming for In PyScript, Please let us know how to help there, or please at least fix that line of code where you set Once that's done, let's figure out why panel in PyScript doesn't work in workers, hence it cannot work in |
I went ahead and tested that panel works in both workers and py-editor if we provide We remain with the:
issue but I can see panel working just fine even from a PyEditor ... you need to remove those lines that branches your logic though around PyScript and if we provide |
FYI this fixed panel in both workers and it looks to me your logic around From our perspective, what works on the main thread should work on workers too, that's the portability promise we try to make, but of course there are possible hiccups, in this case the mentioned error and comments like this we're not aware of or fully sure how to help with: # Ensure we don't try to load MPL WASM backend in worker Once again, we're here to make it happen, so please let's help each other to do so in the best possible way, thank you! |
Thx so much 👍 |
Does not work with historical versions of Pyscript because they no longer exist
If I try the PyScript reference example at https://panel.holoviz.org/how_to/wasm/standalone.html#pyscript, It no longer works because the pyscript .js and .css files no longer exist.
For example https://pyscript.net/releases/2024.2.1/pyscript.js no longer exists.
Might be related to #6991 and pyscript/pyscript#2118
The text was updated successfully, but these errors were encountered: