Effect CommunityEC
Effect Community7mo ago
2 replies
Skosh

Issue with `@effect/platform/Worker` and WebWorkers: TypeError in Effect Internals

Has anyone successfully been running @effect/platform/Worker using WebWorkers?

I'm trying to get it working, but as soon as I add this:

yield* Runner.make((request: unknown) => Effect.gen(function*() {
  yield* Effect.log("Worker received request")
}))


I get cryptic errors from Effect internals:

[Log] [16:01:46.282] ERROR (#0): (worker-runner.js, line 8996)
[Error] TypeError: undefined is not an object (evaluating 'self2.intervals')
@http://localhost:3000/worker-runner.js:21217:23
    (anonymous function) (worker-runner.js:8998)
    (anonymous function) (worker-runner.js:11783)
    withRedactableContext (worker-runner.js:711)
    log (worker-runner.js:11781)
    (anonymous function) (worker-runner.js:8263)
    effect_internal_function (worker-runner.js:474)
    runLoop (worker-runner.js:12212)
    evaluateEffect (worker-runner.js:11843)
    evaluateMessageWhileSuspended (worker-runner.js:11820)
    drainQueueOnCurrentThread (worker-runner.js:11608:115)
    (anonymous function) (worker-runner.js:11307)
    starveInternal (worker-runner.js:7852)


Is this a bug?
Was this page helpful?