Skip to content

Commit 9cc2065

Browse files
committed
fix: wait for EDITOR_READY before sending LOAD_DOCUMENT for local files
1 parent 3b1e84e commit 9cc2065

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

examples/with-playwright-automation/src/automation.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ const runAutomation = async ({ document, baseUrl }: { document: string; baseUrl:
191191
});
192192

193193
if (!isUrl(document)) {
194+
console.log('Waiting for editor to be ready...');
195+
await waitForEvent('EDITOR_READY');
196+
194197
console.log('Loading local file...');
195198
const dataUrl = readFileAsDataUrl({ filePath: document });
196199
const fileName = path.basename(document);

0 commit comments

Comments
 (0)