Skip to content

Commit

Permalink
fix(browser): access from globalThis (#560)
Browse files Browse the repository at this point in the history
This fixes a `ReferenceError` from SSR environments such as Nuxt's
  • Loading branch information
kyranet committed May 19, 2023
1 parent a2fef0a commit a83af48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.ts.template
Original file line number Diff line number Diff line change
Expand Up @@ -2378,7 +2378,7 @@ interface ResolvedCircularCoordinates {
// IF(SKIA): export { Path2D, FontLibrary, NativeImage as Image, loadImage };

// IF(BROWSER): \
export const Image = HTMLImageElement; \
export const Image = globalThis.HTMLImageElement; \
export function loadImage(src: string, options?: Partial<HTMLImageElement>): Promise<HTMLImageElement> { \
return new Promise<HTMLImageElement>((resolve, reject) => { \
// eslint-disable-next-line no-undef \
Expand Down

0 comments on commit a83af48

Please sign in to comment.