mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Fix error in server-side rendering (#2039)
This commit is contained in:
parent
8c04f94bc9
commit
e4d52a1ac6
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user