Github Pages Deployment Bug: ImportError: cannot import name 'document' from 'js'

Hi there, I’m new to Panel and made the decision to use it for my project. Here is my quick repo. It works great locally using panel serve app.py. My main goal is to deploy it on a website accessible through the Internet. I tried deploying using Github Pages, but I seem to get the error in the image below.

So far, I tried working with requirements.txt and making sure to have index.html in the docs directory (and within files). I generated the .html/js files using panel convert with pyodide. My app.py imports matplotlib, numpy, and param. Any ideas?

It’s alright if there’s no workaround for Github Pages deployment, I’d just like to deploy the web app some way or another. Thank you for the help, so far Panel has been great.

FIXED: Seems like matplotlib was causing the issues – I switched over to hvplot and it works fine. Although, does anyone have an intuition on what WebAssembly is actually doing/how it works? What is the reason for the initial load time?

What is the reason for the initial load time?

It’s downloading the entire Python runtime and all required packages.