diff --git a/app/common/BaseAPI.ts b/app/common/BaseAPI.ts index b5294e84..17d9ff69 100644 --- a/app/common/BaseAPI.ts +++ b/app/common/BaseAPI.ts @@ -61,7 +61,7 @@ export class BaseAPI { 'X-Requested-With': 'XMLHttpRequest', ...options.headers }; - if ((window as any)?.isGristBootPage) { + if (typeof window !== 'undefined' && (window as any)?.isGristBootPage) { const parts = (new URL(window.location.href).pathname).split('/'); if (parts[0] === '' && parts[1] === 'boot' && parts[2] !== undefined) { this._headers['X-Boot-Key'] = parts[2];