automerge-repo icon indicating copy to clipboard operation
automerge-repo copied to clipboard

"Error: DocHandle is not ready" with useBootstrap

Open neftaly opened this issue 6 months ago • 3 comments

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"?

neftaly avatar Jan 02 '24 22:01 neftaly