sessionStorage in worker module #13983
Answered
by
crowlKats
mmohammadi9812
asked this question in
Q&A
-
Hi I was trying to use but when I try to run main module ( error: Uncaught (in worker "") TS2339 [ERROR]: Property 'sessionStorage' does not exist on type 'WorkerGlobalScope & typeof globalThis'.
self.sessionStorage.setItem("threadId", e.data.threadId.toString());
~~~~~~~~~~~~~~
at file:///Users/mohammad/....some-path...../worker.ts:46:8 worker module options are: const worker = new Worker(new URL("./lib/worker.ts", import.meta.url).href, {
type: "module",
deno: {
namespace: true,
permissions: {
net: "inherit",
read: true,
write: true,
}
}
}); I tried adding :; deno --version
deno 1.18.2 (release, aarch64-apple-darwin)
v8 9.8.177.6
typescript 4.5.2 any thoughts on this? |
Beta Was this translation helpful? Give feedback.
Answered by
crowlKats
Mar 16, 2022
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mmohammadi9812
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sessionStorage
&localStorage
are not available in workers, as per spec