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

  1. Read the previewJobUpdates payload in the console (it is console.error'd) — it holds the actual server-side error
  2. Fix the underlying script/flow error the preview job reported
  3. Re-run the test/preview after correcting the code
  4. 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

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


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/b8be47a92811f14f. Report an issue: GitHub.