Dexie-cloud's service worker fails due to missing RxJS #2181
-
|
The below config copies the dexie-cloud-addon's service-worker to the root directory, and configures a workbox service-worker to load it via However, the dexie service worker throws at runtime because RxJS is not available Are we supposed to be compiling this ourselves or something? I would have thought the service-worker script was completely standalone and included all necessary dependencies What's the recommended way to configure the dexie cloud service worker? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
|
The service-worker does not bundle neither If the service worker uses importScripts() it should import all three: importScripts('<dexie UMD module, downloaded from https://dexie.org/docs/Download or https://unpkg.com/dexie/dist/dexie.min.js>')
importScripts('<rxjs downloaded from https://unpkg.com/rxjs/dist/bundles/rxjs.umd.min.js>');
importScripts('<dexie-cloud-addon, downloaded from https://unpkg.com/dexie-cloud-addon/dist/umd/dexie-cloud-addon.min.js'>); |
Beta Was this translation helpful? Give feedback.
-
|
Since implementing the service worker, I have noticed that syncing is not working as expected. For example, I currently have two tabs open, made a change in one tab, and the update has not synced to the other tab (which has sat there open for about 4 hours now). If I open a new incognito window incognito and log in, the initial sync works and I see the updates I was looking for, so the data has correctly been persisted in dexie cloud (probably because I made the update via the rest api in the admin ui I built, bypassing indexeddb), but for some reason those changes are not syncing to existing tabs. Note that I added a build number version so I have verified that all the tabs are running the latest code and the service worker is updating/registering itself correctly Any debugging tips? |
Beta Was this translation helpful? Give feedback.
-
|
@dfahlander any ideas? I've had to just disable the |
Beta Was this translation helpful? Give feedback.
The service-worker does not bundle neither
dexieorrxjs.If the service worker uses importScripts() it should import all three: