Comments (8)
I tried to fix this from the RxDB side but this was not really possible. I made a PR at the web-workers package so we might be able to fix it there: developit/web-worker#45
In the meantime you could build your worker file with webpack so it does not import the code it doesnt need. I added the webpack config that is used on the premium packages to the docs: 7a7fd5d#diff-b2b38c09cb3bf9d03ed981e79cdb62f75cf3c9e345e6bd7ab3356574b7fa9e12
from rxdb.
I checked out https://github.com/dmihal/Subworkers and this looks dangerous when used in multiple browser tabs that open and close randomly.
Notice that cross-worker communication is a performance bottleneck so using worker inside of your shared worker likely is slower then just using the shared worker and the subworkers package adds an additional layer of communication.
from rxdb.
Could reproduce your error.
You can debug the shared worker process by opening this url in chrome: chrome://inspect/#workers
I get the in-shared-worker error:
Uncaught ReferenceError: Worker is not defined
at node_modules/web-worker/cjs/browser.js (rxdb-premium_plugins_storage-worker.js?v=7b25e094:24:22)
at __require (chunk-LNEMQRCO.js?v=7b25e094:9:50)
at rxdb-premium_plugins_storage-worker.js?v=7b25e094:461:33
Seems that the problem comes from the web-worker package
This is used inside of the getRxStorageWorker
function, I will check.
from rxdb.
Seems to be a bundling problem because it somehow bundles the getRxStorageWorker
methode inside of the worker where it should normally be tree shaked.
from rxdb.
https://chromestatus.com/feature/6080438103703552
Dedicated workers can create nested workers, but shared workers and service workers cannot.
Creating a nested dedicated worker from a shared worker is not yet supported.
Nested shared workers are also in the spec, but there is no plan to support them at this time.
from rxdb.
I misunderstood it and was looking for a solution for run a dedicated worker from a shared worker.
But I see now, if the web-worker does not return a Worker, it will not be necessary.
That's why I deleted my previous comments.
I wrote that you can use https://github.com/dmihal/Subworkers
But actually it only worked for me in dev mode (vite) and not after build.
from rxdb.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon. If you still have a problem, make a PR with a test case or to prove that you have tried to fix the problem. Notice that only bugs in the rxdb premium plugins are ensured to be fixed by the maintainer. Everything else is expected to be fixed by the community, likely you must fix it by yourself.
from rxdb.
Related Issues (20)
- OPFS implementation - ensureNotFalsy() is falsy HOT 4
- Contribute link not found
- PrematureCommitError when executing sample Vue code from cdn HOT 3
- Provide an option to suppress the dev-mode warning message HOT 6
- Error "Update expression must contain only one operator" HOT 2
- Issue with 'could not requestRemote' during migration from v14 -> v15 (indexedDb RxStorage) HOT 12
- Replication observation mode ignored when push handler is waiting for response from backend HOT 5
- Firestore Replication Validation Errors being thrown HOT 7
- Update the RxDB Examples so that they use the new RxServer for replication instead of the pouchdb/couchdb server. HOT 5
- Add electric-sql to the client-side-databases project to measure the performance metrics. HOT 17
- Collection change events corrupt keys containing square brackets when key compression is enabled HOT 3
- Maximum call stack size exceeded during encryptString HOT 14
- RxReactivityFactory & Svelte 5 HOT 3
- Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail. HOT 3
- Add support for GeoJSON data in RxSchema HOT 6
- Please Sign the Open Letter to Tim Cook: Sabotaging Web Apps Is Indefensible HOT 2
- RxDB "Cannot open database state with newer RxDB version" error when trying to update from v13 to v15 HOT 1
- RxDB does not respond to collection.remove() changes. HOT 18
- Yes this feature is missing, you can do a pull request. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rxdb.