You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a react component which expects to find 2 parameters in the URL (database name, doc id). It expects to open the name database, set up a sync with a remote endpoint, and load the document with the provided doc id. I expect in most cases the document will not exist yet locally, only after sync has been established.
In the past, this "just worked'. Maybe that was always an accident, but I suspect that something in the connect call previously blocked in a way that it no longer does.
Note, that in this case, I wait for cx.loaded to resolve, and then I wait an additional 5s. When I do this, and wait the full 5s, although I get errors in the console, the doc eventually loads correctly.
Errors I see in the console:
Uncaught (in promise) Error: Not found: 0193458d-2f46-770b-bf57-52d78473caef - {"module":"CRDT"}
g utils.ts:323
t database.ts:90
promise callback*get database.ts:89
yw Document.tsx:30
yw Document.tsx:33
React 3
_ scheduler.production.min.js:13
T scheduler.production.min.js:14
7756 scheduler.production.min.js:14
Webpack 12
utils.ts:323:7
Uncaught (in promise) TypeError: e is null
s store.ts:166
updateParentsFromDbMetas store.ts:166
load store.ts:189
loaded connection-base.ts:68
promise callback*connectMeta_X connection-base.ts:67
connect_X connection-base.ts:48
gw index.ts:48
once resolve-once.ts:113
gw index.ts:45
yw Document.tsx:19
React 6
_ scheduler.production.min.js:13
T scheduler.production.min.js:14
7756 scheduler.production.min.js:14
Webpack 12
store.ts:166:62
Without the sleep I see the same errors, but never get the content loaded. I have tried useDocument, and different variations of waiting for cx.loaded, all to no avail.
How can I do this correctly, without getting any errors in the console, and without having to wait 5s?
The text was updated successfully, but these errors were encountered:
With help from @icidasset I was able to eliminate the errors, and have the application behave correctly. However, this work around (developed by Steven) does not appear to be the correct final resolution.
I have a react component which expects to find 2 parameters in the URL (database name, doc id). It expects to open the name database, set up a sync with a remote endpoint, and load the document with the provided doc id. I expect in most cases the document will not exist yet locally, only after sync has been established.
In the past, this "just worked'. Maybe that was always an accident, but I suspect that something in the connect call previously blocked in a way that it no longer does.
Let me illustrate the one pattern that does work:
Note, that in this case, I wait for
cx.loaded
to resolve, and then I wait an additional 5s. When I do this, and wait the full 5s, although I get errors in the console, the doc eventually loads correctly.Errors I see in the console:
Without the sleep I see the same errors, but never get the content loaded. I have tried useDocument, and different variations of waiting for
cx.loaded
, all to no avail.How can I do this correctly, without getting any errors in the console, and without having to wait 5s?
The text was updated successfully, but these errors were encountered: