diff --git a/dialog/internal/dialog.ts b/dialog/internal/dialog.ts index c29cc56a37..5e14685aad 100644 --- a/dialog/internal/dialog.ts +++ b/dialog/internal/dialog.ts @@ -152,7 +152,7 @@ export class Dialog extends dialogBaseClass { // focusable elements. TreeWalker is faster than `querySelectorAll('*')`. // We check for isServer because there isn't a "document" during an SSR // run. - private readonly treewalker = isServer ? {} : document.createTreeWalker( + private readonly treewalker = isServer ? {} as TreeWalker : document.createTreeWalker( this, NodeFilter.SHOW_ELEMENT, );