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

Automerge-Repo in a SharedWorker under Vite loses "connect". #140

Closed
pvh opened this issue Aug 9, 2023 · 1 comment
Closed

Automerge-Repo in a SharedWorker under Vite loses "connect". #140

pvh opened this issue Aug 9, 2023 · 1 comment

Comments

@pvh
Copy link
Member

pvh commented Aug 9, 2023

See also: Menci/vite-plugin-wasm#37

In the meantime, Orion has a workaround which just recreates the worker after a couple hundred MS but... it's ugly, and it makes using a SharedWorker very inconvenient. There are a few ways we could reduce the grossness of this without waiting for an upstream fix in Chrome but I think it might boil down to including an async import.

We don't 100% have to fix this before 1.0 but it's just so awful I'd like to fit it in if we have time.

@pvh pvh changed the title Automerge-Repo in a SharedWorker under Vite has PROBLEMS. Automerge-Repo in a SharedWorker under Vite loses "connect". Aug 9, 2023
@pvh
Copy link
Member Author

pvh commented Aug 11, 2023

I've fixed this with dynamic imports as a workaround; it's inelegant and vaguely embarrassing to include in example code but it's less bad than the old "just keep remaking the worker" approach.

@pvh pvh closed this as completed Aug 11, 2023
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