Huh, that's interesting. Does the following code work for you then, if you put it in a file like test.html and then open that in a browser, either via file:///path/to/test.html or on something like http://localhost/test.html?
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/vanjs-org/van/public/van-1.5.2.nomodule.min.js"></script> <script> const {button, div, pre} = van.tags const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)) const Run = ({sleepMs}) => { const steps = van.state(0) ;(async () => { for (; steps.val < 40; ++steps.val) await sleep(sleepMs) })() return pre(() => `${" ".repeat(40 - steps.val)}ππ¨Hello VanJS!${"_".repeat(steps.val)}`) } const Hello = () => { const dom = div() return div( dom, button({onclick: () => van.add(dom, Run({sleepMs: 2000}))}, "Hello π"), button({onclick: () => van.add(dom, Run({sleepMs: 500}))}, "Hello π’"), button({onclick: () => van.add(dom, Run({sleepMs: 100}))}, "Hello πΆββοΈ"), button({onclick: () => van.add(dom, Run({sleepMs: 10}))}, "Hello ποΈ"), button({onclick: () => van.add(dom, Run({sleepMs: 2}))}, "Hello π"), ) } van.add(document.body, Hello()) </script>
For me, in Firefox, this throws the aforementioned exception in the console while showing a blank webpage. Adding type=module in the second line makes it work