diff --git a/packages/utils/src/dom.ts b/packages/utils/src/dom.ts index e376a67aef..a7132af975 100644 --- a/packages/utils/src/dom.ts +++ b/packages/utils/src/dom.ts @@ -155,6 +155,9 @@ export function printCanvas(canvas: HTMLCanvasElement) { export function getViewPortScale() { const meta = document.querySelector('meta[name="viewport"]'); + if (!meta) { + return 1; + } const contentItems = (meta as any).content?.split(','); const scale = contentItems.find((item: string) => { const [key, value] = item.split('=');