diff --git a/packages/storycap/src/node/capturing-browser.ts b/packages/storycap/src/node/capturing-browser.ts index 0707705b7..2a3757083 100644 --- a/packages/storycap/src/node/capturing-browser.ts +++ b/packages/storycap/src/node/capturing-browser.ts @@ -106,7 +106,7 @@ export class CapturingBrowser extends StoryPreviewBrowser { getCurrentVariantKey: () => this.currentVariantKey, waitBrowserMetricsStable: () => this.waitBrowserMetricsStable('preEmit'), }; - Object.entries(exposed).forEach(([k, f]) => this.page.exposeFunction(k, f)); + await Promise.all(Object.entries(exposed).map(([k, f]) => this.page.exposeFunction(k, f))); } private async reload() {