I have noticed that when contains invalid TOML, we have several unexpected things, but I could not find a common pattern so I'm reporting all of them here.
Case 1: invalid syntax
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PyScript Error</title>
<script type="module" src="https://cdn.jsdelivr.net/npm/@pyscript/core@latest"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@pyscript/core/dist/core.css">
<py-config>
[[fetch]]
files = ["pyterminal.py"]this is a syntax error
</py-config>
<script type="py">
print('hello')
</script>
</head>
</html>
Here I correctly get an error in the console:

However:
- errors should be displayed to the DOM by default
- the error message says something about JSON which is very confusing, since
<py-config> is supposed to contain TOML
Case 2: another invalid syntax, completely ignored
<py-config>
this is invalid syntax
</py-config>
<script type="py">
print('hello')
</script>
In this case, the py-config is just silently ignored and hello is normally printed.
I would expect that in case of syntax error in the config, the execution of the page stops and the error is displayed to the DOM.
Case 3: I cannot really understand what's happening
<py-config>
[[fetch]]
files =
</py-config>
<script type="py">
print('hello')
</script>
Here I get yet another error, but also I see that it tries to fetch config.txt, which I don't really know where it comes from 🤔

I have noticed that when contains invalid TOML, we have several unexpected things, but I could not find a common pattern so I'm reporting all of them here.
Case 1: invalid syntax
Here I correctly get an error in the console:

However:
<py-config>is supposed to contain TOMLCase 2: another invalid syntax, completely ignored
In this case, the
py-configis just silently ignored andhellois normally printed.I would expect that in case of syntax error in the config, the execution of the page stops and the error is displayed to the DOM.
Case 3: I cannot really understand what's happening
Here I get yet another error, but also I see that it tries to fetch
config.txt, which I don't really know where it comes from 🤔