r-wasm / quarto-drop

Drop down an interactive R or Python console, code editor, and plotting window from the top of your Quarto slides.
https://r-wasm.github.io/quarto-drop/
MIT License
158 stars 4 forks source link

wasm instantiation fails for pyodide engine #6

Closed statik closed 3 months ago

statik commented 4 months ago

I love this extension!

I'm trying to use drop on a revealjs presentation that is in a subdirectory of a quarto website project. It works fine with the webr engine, but the pyodide engine fails to instantiate due to a javascript exception. I wasn't able to track down exactly what is going wrong, but I was able to put together a minimal reprex at https://github.com/statik/reprex-drop.

If you clone that repo and run quarto preview, you should be able to click into the presentation, try opening the drop console, and look at the browser developer tools to see the exception. I am running this on Chrome Version 126.0.6478.183 (Official Build) (arm64) on macOS. Thanks for your help!

statik commented 4 months ago
Screenshot 2024-07-24 at 10 18 30 AM
statik commented 4 months ago

huh, I'm actually seeing pyodide fail when running quarto preview python-example.qmd from this repo directly.

statik commented 4 months ago

I see 403 forbidden when trying to access https://cdn.jsdelivr.net/pyodide/v0.26.1/full/, which is the URL listed on https://pyodide.org/en/stable/usage/downloading-and-deploying.html and in

https://github.com/r-wasm/quarto-drop/blob/4a4b3cf600c63f45385b9e6e12e2973d47743f45/drop-runtime/src/App.tsx#L125

georgestagg commented 4 months ago

Hmmm, strange!

The forbidden response is expected for that path, but can you access the full URL at https://cdn.jsdelivr.net/pyodide/v0.26.1/full/pyodide.asm.js in Chome? What about Safari?

I can't reproduce at my end. This is looking like it might be some kind of network issue, but I'm unsure.

Could you please look for pyodide.asm.js (or some other file under the above URL) in your Chrome dev tools network log and show me the details of that particular connection? Here is what a good connection should look like:

Screenshot 2024-07-25 at 09 51 44

This problem might also be avoided with #4, but that will require some work to implement.

statik commented 3 months ago

thank you for looking at this! I started working on creating a HAR recording to reproduce, and did that in an incognito window. Things started working! I then went through and disabled some Chrome Extensions, and pyodide works now. I did see that even when the initialization was failing, pyodide.asm.js did successfully fetch over the network.

It turns out that Mokku Chrome extension was breaking things. I have removed that extension.