From 3231720004ff9d637b37eb2ce46271e79264a490 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Sun, 16 Nov 2025 21:26:42 -0700 Subject: [PATCH] fix: add await to repo.find() call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit repo.find() returns a Promise, not DocHandle directly. Added missing await keyword to fix TypeScript build error. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/automerge/useAutomergeSyncRepo.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/automerge/useAutomergeSyncRepo.ts b/src/automerge/useAutomergeSyncRepo.ts index da44d2f..ac26137 100644 --- a/src/automerge/useAutomergeSyncRepo.ts +++ b/src/automerge/useAutomergeSyncRepo.ts @@ -153,9 +153,9 @@ export function useAutomergeSync(config: AutomergeSyncConfig): TLStoreWithStatus const docUrl = `automerge:${documentId}` as const try { - // Try to find the existing document - this is synchronous + // Try to find the existing document // It will throw if the document isn't in the repo yet - handle = repo.find(docUrl as any) + handle = await repo.find(docUrl as any) console.log(`✅ Found existing document handle: ${handle.documentId}, isReady: ${handle.isReady()}`) } catch (error) { // If find() throws (document unavailable), the document doesn't exist in this repo yet