Home > database >  pyscript stopped working after chrome update
pyscript stopped working after chrome update

Time:05-15

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>
    </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?

CodePudding user response:

I added

<py-env>
    - altair
    - pandas
    - vega_datasets
</py-env>

to the <head> and now the page renders correctly.

CodePudding user response:

Yesterday and today (5/13 and 5/14), the PyScript team is changing pyscript.js.

  1. They have broken the package at least twice and then fixed it a few minutes later.

  2. 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.

  • Related