'pyscript stopped working after chrome update
I created the simplest implementation of pyscript to get started:
<html>
<head>
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
<py-env>
</py-env>
</head>
<body>
<py-script> print('Now you can!') </py-script>
</body>
</html>
It worked, yay. But then I saw that chrome had updates so I updated chrome and the browser closed, updated, then reopened but now my pyscript page does not work, instead a light-red box populates to the top of the page and the console shows a lot of errors. What do I do?
Solution 1:[1]
I added
<py-env>
</py-env>
to the <head> and now the page renders correctly.
Solution 2:[2]
Yesterday and today (5/13 and 5/14), the PyScript team is changing pyscript.js.
They have broken the package at least twice and then fixed it a few minutes later.
I am also noticing intermittent fetch errors loading the PyScript packages. Reloading the page using works for the second issue.
Open the Chrome debugger and look for error messages. This will tell you whether it is a fetch package problem (reload the page) or a bug in pyscript.js (wait a couple of hours and try again).
This is happening enough that I keep versions of pyscript.js and pyscript.css on my development machine so that I can continue developing while they fix the updates.
Solution 3:[3]
This sounds like PyScript issue #370. There's not much that you can do aside from either using an older version or waiting for the devs to fix it.
Edit on 2022-05-17: this should now be fixed.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | John Hanley |
| Solution 3 |
