diff --git a/packages/canonical-bridge/src/views/index.tsx b/packages/canonical-bridge/src/views/index.tsx index fc3683c9d28c4..6a8cde31fc31b 100644 --- a/packages/canonical-bridge/src/views/index.tsx +++ b/packages/canonical-bridge/src/views/index.tsx @@ -40,7 +40,7 @@ export const CanonicalBridge = (props: CanonicalBridgeProps) => { const { setLastUpdated: refresh } = useLastUpdated() useEffect(() => { - if (typeof document !== 'undefined') { + if (typeof document !== 'undefined' && document) { const inputElement = document.querySelector('.bccb-widget-transfer-input') as HTMLInputElement | null if (inputElement) { inputElement.setAttribute('pattern', '^[0-9]*[.,]?[0-9]*$')