diff --git a/src/browser/run/runner.ts b/src/browser/run/runner.ts index 0cd8eb9..a37ccb9 100644 --- a/src/browser/run/runner.ts +++ b/src/browser/run/runner.ts @@ -446,7 +446,7 @@ export async function runBrowserProgram( rejectRun = undefined; } try { - const serialized = JSON.stringify(value); + const serialized = JSON.stringify(value === undefined ? null : value); if (serialized === undefined) throw new TypeError('Result is not JSON serializable.'); return serialized; } catch (cause) {