diff --git a/src/lib/core/compatibility/compatibility.ts b/src/lib/core/compatibility/compatibility.ts index 341e5af7fdd6..faa00bcda7ae 100644 --- a/src/lib/core/compatibility/compatibility.ts +++ b/src/lib/core/compatibility/compatibility.ts @@ -190,7 +190,7 @@ export class CompatibilityModule { } private _checkTheme(): void { - if (this._document) { + if (this._document && typeof getComputedStyle === 'function') { const testElement = this._document.createElement('div'); testElement.classList.add('mat-theme-loaded-marker');