Open natteko opened 5 days ago
Writing anything related to timers is not great in the REPL. One should essentially write them backwards, starting with the cleanup because you otherwise easily end up with timers that are never cleaned up.
Example used for this tutorial should maybe just be replaced with something else.
Describe the bug
The tutorial puts an emphasis on the user typing code out manually from the markup blob, as opposed to copy pasting. However the sampling rate of the REPL contradicts this philosophy. This is especially evident in the effects exercise. If the user copy pastes the code, the result is as expected and the
elapsed
counter value immediately begins going up. However, if the user types out the code manually, the behaviour of the the counter is indeterminate. It may begin counting up after an unknown time period, or the user may get an unexpected token error in the Svelte output window. The reason for this may be due to how frequently the REPL samples the code and runs it. This is evident when (the real) console is opened, and it is shown to be fludded with errors akin to (["e", "el", "ela", "elap", ...] is not defined") errors.Reproduction
Typing out the the initial $effect code snippet on https://svelte.dev/tutorial/svelte/effects into the REPL environment
Logs
System Info
Severity
annoyance