automerge-repo
automerge-repo copied to clipboard
"Error: DocHandle is not ready" with useBootstrap
I encountered a sharp edge building a simple useBootstrap
app. I must have initialized useBootstrap with an empty or broken onNoDocument
function, which resulted in the document ID being saved to localstorage, but the document itself not being created.
Whenever I tried to write anything, I got the following console.error:
Uncaught Error: DocHandle#... is not ready. Check `handle.isReady()` before accessing the document.
It was not immediately obvious what was happening, and the error persisted between reloads. I have encountered this before and would like it to be easier to diagnose for someone unfamiliar with the library.
- The error message could provide a link to a documentation page with more information?
- The chrome devtools could log a message like "useBootstrap: loading existing documentId from localstorage"?