diff --git a/dialog/internal/dialog.ts b/dialog/internal/dialog.ts index cc86fd33c0..a8b610beae 100644 --- a/dialog/internal/dialog.ts +++ b/dialog/internal/dialog.ts @@ -153,7 +153,7 @@ export class Dialog extends LitElement { // 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, );