Skip to content

Commit b436f33

Browse files
fix: guard against document being undefined in embed-iframe informAboutScroll (calcom#28596)
* fix: guard against document being undefined in informAboutScroll to fix flaky test * fix: update comment to not reference test environment
1 parent 15005d8 commit b436f33

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • packages/embeds/embed-core/src/embed-iframe/lib

packages/embeds/embed-core/src/embed-iframe/lib/utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ export function keepParentInformedAboutDimensionChanges({ embedStore }: { embedS
6666
let isInitialDimensionPass = true;
6767
let isWindowLoadComplete = false;
6868
runAsap(function informAboutScroll() {
69+
// Can't inform parent about dimensions if document doesn't exist
70+
if (typeof document === "undefined") {
71+
return;
72+
}
6973
if (document.readyState !== "complete") {
7074
// Wait for window to load to correctly calculate the initial scroll height.
7175
runAsap(informAboutScroll);

0 commit comments

Comments
 (0)