I've faced some interesting issue.
The problem is when I run the code snippet with pyodide and console is opened it works properly:
import pandas
import plotly.express as px
df = px.data.iris()
fig = px.scatter(
df, x="sepal_width", y="sepal_length",
color="species")
fig
Otherwise when I try to run the same code snippet and console is closed, it gets broken then these logs appear (if I open a console when everything's broken):
Assuming you are using Chrome, it's very likely a bug in Chrome 89 - 90, which should be fixed in Chrome 91.
For more details see: pyodide#1507 and bugs.chromium.org#1200031