diff --git a/packages/frontend/core/src/components/doc-properties/table.tsx b/packages/frontend/core/src/components/doc-properties/table.tsx
index ac768c748..16fe542a2 100644
--- a/packages/frontend/core/src/components/doc-properties/table.tsx
+++ b/packages/frontend/core/src/components/doc-properties/table.tsx
@@ -23,6 +23,7 @@ import {
DocsService,
useLiveData,
useService,
+ useServiceOptional,
} from '@toeverything/infra';
import clsx from 'clsx';
import type React from 'react';
@@ -245,7 +246,7 @@ export const DocPropertiesTableBody = forwardRef<
const t = useI18n();
const docsService = useService(DocsService);
const workbenchService = useService(WorkbenchService);
- const viewService = useService(ViewService);
+ const viewService = useServiceOptional(ViewService);
const properties = useLiveData(docsService.propertyList.sortedProperties$);
const [propertyCollapsed, setPropertyCollapsed] = useState(true);
@@ -312,20 +313,22 @@ export const DocPropertiesTableBody = forwardRef<
{t['com.affine.page-properties.add-property']()}
- }
- className={clsx(
- styles.propertyActionButton,
- styles.propertyConfigButton
- )}
- onClick={() => {
- viewService.view.activeSidebarTab('properties');
- workbenchService.workbench.openSidebar();
- }}
- >
- {t['com.affine.page-properties.config-properties']()}
-
+ {viewService ? (
+ }
+ className={clsx(
+ styles.propertyActionButton,
+ styles.propertyConfigButton
+ )}
+ onClick={() => {
+ viewService.view.activeSidebarTab('properties');
+ workbenchService.workbench.openSidebar();
+ }}
+ >
+ {t['com.affine.page-properties.config-properties']()}
+
+ ) : null}