Skip to content

onmessage is not called when importing module #37

@5d-jh

Description

@5d-jh

If import module from deno side code, self.onmessage is not getting called.

// node-side.ts
const worker = new Worker(new URL('deno-side.ts'), { allowAll: true });
worker.postMessage({ message: 'hi' })
// deno-side.ts
self.onmessage = (e) => {
  // this is getting invoked, but
}
// deno-side.ts
import { something } from './something.ts'; 

self.onmessage = (e) => {
  // this is NOT getting invoked
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions