From b867f0eef8d036ff76c246761c92b33a420c7775 Mon Sep 17 00:00:00 2001 From: Samuel Teixeira Date: Thu, 28 May 2020 00:10:24 +0100 Subject: [PATCH] Add await into worker.ts I am running this code on Mac, if I did not add that 'await' in the front of the console.log I have the error: deno run --allow-read main.ts hello world thread 'deno-worker-0' panicked at 'Failed to post message to host: TrySendError { kind: Disconnected }', cli/ops/worker_host.rs:142:7 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace thread 'main' panicked at 'Worker thread panicked: Any', cli/ops/worker_host.rs:329:11 --- docs/runtime/workers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/runtime/workers.md b/docs/runtime/workers.md index 110255b8b63bc2..9ff44961ae88af 100644 --- a/docs/runtime/workers.md +++ b/docs/runtime/workers.md @@ -34,7 +34,7 @@ new Worker("./worker.ts", { type: "module" }); **worker.ts** ```ts -console.log("hello world"); +await console.log("hello world"); self.close(); ```