Skip to content

Commit

Permalink
fix: will show import error message + allow to rerun if any worker er…
Browse files Browse the repository at this point in the history
…r occurs (#167)

* fix: will show import error message + allow to rerun if any worker error occurs

* patch

* Update RunFrame.tsx
  • Loading branch information
ArnavK-09 authored Jan 30, 2025
1 parent c5aa973 commit 5ac6ff8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/components/RunFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,15 @@ export const RunFrame = (props: Props) => {
.then(() => ({ success: true }))
.catch((e: any) => {
// removing the prefix "Eval compiled js error for "./main.tsx":"
const message = e.message.split(":")[1]
const message: string = e.message.includes(":")
? e.message.replace(/[^:]+:/, "")
: e.message
props.onError?.(e)
setError({ error: message, stack: e.stack })
console.error(e)
return { success: false }
})
if (!evalResult.success) return
if (!evalResult.success) return setIsRunning(false)

const $renderResult = worker.renderUntilSettled()

Expand Down

0 comments on commit 5ac6ff8

Please sign in to comment.