Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start ShareWorker from Worker #104

Open
cpatti97100 opened this issue Jun 18, 2021 · 0 comments
Open

Start ShareWorker from Worker #104

cpatti97100 opened this issue Jun 18, 2021 · 0 comments

Comments

@cpatti97100
Copy link

cpatti97100 commented Jun 18, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant