Fix error in server-side rendering (#2039)

This commit is contained in:
Liwen Guo 2019-11-26 05:16:07 +01:00 committed by Niklas von Hertzen
parent 8c04f94bc9
commit e4d52a1ac6

View File

@ -25,7 +25,9 @@ const html2canvas = (element: HTMLElement, options: Partial<Options> = {}): Prom
export default html2canvas; export default html2canvas;
if (typeof window !== "undefined") {
CacheStorage.setContext(window); CacheStorage.setContext(window);
}
const renderElement = async (element: HTMLElement, opts: Partial<Options>): Promise<HTMLCanvasElement> => { const renderElement = async (element: HTMLElement, opts: Partial<Options>): Promise<HTMLCanvasElement> => {
const ownerDocument = element.ownerDocument; const ownerDocument = element.ownerDocument;