diff --git a/repl/README.md b/repl/README.md index dbb9d6c1..ebc05fe5 100644 --- a/repl/README.md +++ b/repl/README.md @@ -46,6 +46,6 @@ currently broken / buggy: - [x] scheduler.getPhase is quantized to clock interval - => draw was choppy + that also caused useHighlighting bugs - [x] pianoroll keeps rolling when pressing stop -- [ ] find a way to display errors when console is closed / another tab selected +- [x] find a way to display errors when console is closed / another tab selected - [ ] highlighting out of range error is back (delete large chunk at the top while highlighting below is triggered) - [ ] idea: interpolate between running and evaluated code! diff --git a/repl/src/App.jsx b/repl/src/App.jsx index 17b021fe..741cd351 100644 --- a/repl/src/App.jsx +++ b/repl/src/App.jsx @@ -109,21 +109,22 @@ function App() { const [isZen, setIsZen] = useState(false); const [pending, setPending] = useState(false); - const { code, setCode, scheduler, evaluate, activateCode, isDirty, activeCode, pattern, started, stop } = useStrudel({ - initialCode: '// LOADING', - defaultOutput: webaudioOutput, - getTime, - autolink: true, - beforeEval: () => { - cleanupUi(); - cleanupDraw(); - setPending(true); - }, - afterEval: () => { - setPending(false); - }, - onToggle: (play) => !play && cleanupDraw(false), - }); + const { code, setCode, scheduler, evaluate, activateCode, isDirty, activeCode, pattern, started, stop, error } = + useStrudel({ + initialCode: '// LOADING', + defaultOutput: webaudioOutput, + getTime, + autolink: true, + beforeEval: () => { + cleanupUi(); + cleanupDraw(); + setPending(true); + }, + afterEval: () => { + setPending(false); + }, + onToggle: (play) => !play && cleanupDraw(false), + }); // init code useEffect(() => { @@ -264,6 +265,9 @@ function App() { }} /> + {error && ( +