Skip to content

Start ShareWorker from Worker #104

Open
@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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions