From ba829be8e9190da905ba246460ded18b578292d8 Mon Sep 17 00:00:00 2001 From: CC Worker Date: Mon, 1 Jun 2026 06:10:11 +0000 Subject: [PATCH] =?UTF-8?q?fix(canvas):=20call=20ensureStoreIsUsable()=20b?= =?UTF-8?q?efore=20tldraw=20mount=20=E2=80=94=20pre-initializes=20TLINSTAN?= =?UTF-8?q?CE/page/camera=20records=20in=20empty=20store=20preventing=20cu?= =?UTF-8?q?rrentPageId=20crash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/tldraw/singlePlayerPage.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/tldraw/singlePlayerPage.tsx b/src/pages/tldraw/singlePlayerPage.tsx index cd0a740..688963b 100644 --- a/src/pages/tldraw/singlePlayerPage.tsx +++ b/src/pages/tldraw/singlePlayerPage.tsx @@ -98,6 +98,9 @@ export default function SinglePlayerPage() { shapeUtils: allShapeUtils, bindingUtils: allBindingUtils }); + // Pre-initialize tldraw's required records (TLINSTANCE, page, cameras) + // so computed signals that read currentPageId don't crash before Editor construction completes + (newStore as unknown as { ensureStoreIsUsable(): void }).ensureStoreIsUsable(); const snapSvc = new NavigationSnapshotService(newStore, editorRef.current || undefined); if (accessToken) snapSvc.setAccessToken(accessToken);