I have a github repo that is hosted on GitHub Pages (project site). I’m migrating a small PyScript demo to GitHub Pages and hitting 404s when preloading files via <py-config>. This works locally and also worked previously with an older PyScript alpha*. The github repo contains an index.html and static files live in a src/ folder. I use PyScript, a recent release, 2025.10.3.
For illustration, this is how my code looks:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>demo</title>
<!-- -->
<link rel="stylesheet" href="https://pyscript.net/releases/2025.10.3/core.css" />
<script type="module" src="https://pyscript.net/releases/2025.10.3/core.js"></script>
<py-config>
{
"packages": ["numpy"],
"files": {
"/src/module.py": "./module.py",
"/src/data.npz": "src/data.npz"
},
"paths": ["/src"]
}
</py-config>
</head>
<py-script>
import module # expected to work because it is on sys.path
import numpy as np
arr = np.load("/src/data.npz") #e.g.
print("OK")
</py-script>
</html>
All works ok when I run it locally, the module and the file get both loaded. However, when I push it to GitHub Pages, the network panel shows 404s for those files. The browser tries URLs that don’t exist for the deployed site (e.g., resolving from the domain root, or from the wrong folder, or from hidden files -- the repo itself is not public). What is the correct way of dealing with the files? How can I serve them or source them without absolute paths (I would like to avoid putting out the files and hardwiring the path) in the same way as it used to in pyscript?
Thanks.
*That was implemented as:
<py-env>
- numpy
- paths:
- src/module.py
- src/data.npz
</py-env>