Skip to content
This repository was archived by the owner on Apr 19, 2026. It is now read-only.
This repository was archived by the owner on Apr 19, 2026. It is now read-only.

Start ShareWorker from Worker #104

@cpatti97100

Description

@cpatti97100

Hello all and thanks for this lib :)

I can successfully start a Worker and SharedWorker from my react app, but I would like to initiate the SharedWorker from a Worker insted, so that I do not need to pass values around too much.

worker.js

const sharedWorkerInstance = new SharedWorker(
    '../sharedWorker/webSocket-shared-worker.ts',
    { type: 'module' }
);

webpack.config.js

new WorkerPlugin({
    sharedWorker: true,
}),

but unfortunately I get ReferenceError: SharedWorker is not defined

any ideas? thanks!

Notes: latest comlink + worker-plugin

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