windmill-labs/windmill · error · Error
SSE error: ${previewJobUpdates}
Error message
SSE error: ${previewJobUpdates} What it means
loadTestJobWithSSE opens a Server-Sent Events stream for a preview/test job's updates. When the server pushes an event of type 'error', the current EventSource is closed and an Error carrying the stream payload (previewJobUpdates) is thrown so watchers surface the backend-side job failure.
Source
Thrown at frontend/src/lib/components/JobLoader.svelte:829
return
}
try {
const previewJobUpdates = JSON.parse(event.data)
let type = previewJobUpdates.type
if (type == 'timeout') {
currentEventSource?.close()
currentEventSource = undefined
loadTestJobWithSSE(id, 0, callbacks)
return
} else if (type == 'ping') {
setNoPingTimeout(id, attempt, callbacks)
return
} else if (type == 'error') {
currentEventSource?.close()
currentEventSource = undefined
console.error('SSE error:', previewJobUpdates)
throw new Error('SSE error: ' + previewJobUpdates)
} else if (type == 'not_found') {
currentEventSource?.close()
currentEventSource = undefined
console.error('Not found')
throw new Error('Not found')
}
jobUpdateLastFetch = new Date()
if (job) {
updateJobFromProgress(previewJobUpdates, job, callbacks)
} else if (onlyResult && callbacks?.running && previewJobUpdates.running) {
callbacks?.running?.({ id })
}
if (onlyResult && previewJobUpdates.new_result_stream) {
resultOnlyResultStream = resultOnlyResultStream.concat(
previewJobUpdates.new_result_stream
)View on GitHub (pinned to e474e8803c)
Solutions
- Read the previewJobUpdates payload in the console (it is console.error'd) — it holds the actual server-side error
- Fix the underlying script/flow error the preview job reported
- Re-run the test/preview after correcting the code
- If the stream repeatedly errors, check backend worker health and job logs in the runs view
Example fix
// before
try { await loadTestJobWithSSE(...) } catch (e) { /* raw error */ }
// after
try { await loadTestJobWithSSE(...) }
catch (e) {
if (String(e.message).startsWith('SSE error:')) showJobErrorToast(e.message.slice('SSE error: '.length))
else throw e
} Defensive patterns
Strategy: try-catch
Try / catch
try {
await loadTestJobWithSSE(id, callbacks)
} catch (e) {
if (String(e.message).startsWith('SSE error:')) {
// payload was console.error'd; surface the server-side job error
showJobErrorToast(e.message)
} else throw e
} Prevention
- Watch the console for the raw previewJobUpdates payload — it contains the real server error
- Fix script/flow errors before re-running previews
- Monitor worker health if preview jobs fail repeatedly
When it happens
Trigger: The SSE stream for a test/preview job sends `{type: 'error'}` — i.e. the job itself errored server-side (script failure, worker crash, invalid code) while being watched.
Common situations: Previewing a script/flow/app in the editor where the underlying test job fails at runtime; backend workers reporting an error for the preview job; malformed or failing job code during live preview.
Related errors
- Not found
- No response body for SSE stream
- e.to_string() (Bedrock stream receive error wrapped in io::E
- Job ${jobId} was not successful: ${JSON.stringify(error)}
- Failed to re-run job ${id}.
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/b8be47a92811f14f.
Report an issue: GitHub.