Docs / Troubleshooting
My Run was stopped
JSpark stops a Run that stays busy too long, uses too much memory, or loops too many times. The console says which.
On this page
Which limit stopped it
Read the console. A limit prints a card that names it, and the footer says the same. What the Run printed before it was stopped stays above the card.
The time limit
JSpark stops code that stays busy without a pause for longer than the time limit, 5 seconds by default. This is usually an endless loop. A server, or a timer that waits between events, is not busy: it keeps running until you press Stop or ⌘. or Ctrl+..
In the Timeline, the time limit covers the whole recording, and the card says Stopped after 5s.
The memory limit
JSpark stops a Run that uses more memory than the memory limit, 1 GB by default, before it slows down your computer. In the Timeline, the recording may use up to half of it.
The loop guard
A loop that repeats 20,000,000 times is stopped by the loop guard. It throws aRangeError that names the line. Click the line in the error to go to it.
Give it more
First check the code. A Run that is stopped is most often a loop that never ends, or data that keeps growing.
If the code is right and needs more, change the limit in Settings → Running:Time limit or Memory limit per run. In JSpark, the time limit goes up to 5 seconds, and the memory limit is fixed at 1 GB. The loop guard has no setting. See Time and memory limits.
Run longer or with more memory JSpark+
In JSpark+, the button on the card runs the Snippet again with more, for that Run only:
- Run longer gives it four times the time limit, up to 10 seconds.
- Run with more memory gives it twice the memory limit, up to 8 GB.
The next Run has the limit in Settings again. In JSpark+, the time limit goes up to 10 seconds and the memory limit from 256 MB to 8 GB. In JSpark, the buttons say that this needs JSpark+.
Run the code a moment after you stop typing. Off: only when you press Run (⌘↵). Code that reaches outside — files, network — waits for Run either way.
How long to wait after your last keystroke before running. Shorter feels live; longer runs less often while you think.
Stops code that stays busy this long without a pause, like an endless loop. A server or a timer that waits between events keeps going until you press Stop. In the Timeline, it limits the whole recording.
Stops a run that uses more memory than this, before it slows down your computer. Raise it for large data. In the Timeline, the recording may use up to half of it.
TypeScript
Off: type errors are underlined and the code runs anyway. On: they are printed in the console and nothing runs.
Language for new Snippets
No type checking.
New Snippets run as
Always strict. Uses import, export and top-level await, like a .mjs file. Snippets you already have keep the one they were made with.
The pictures show JSpark on a Mac. On Windows, the window looks a little different and uses Ctrl for ⌘, but everything works the same way.