Skip to content

Commit

Permalink
fix: Update packages/img/src/getImage.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Jordan Harband <ljharb@gmail.com>
  • Loading branch information
ntucker and ljharb committed Mar 1, 2021
1 parent 7fee744 commit 9665cc6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/img/src/getImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const getImage: EndpointInstance<
): Promise<string> {
return new Promise(resolve => {
// even if we polyfill, on server we don't want to actually wait to resolve the Image
if (typeof window === 'undefined' || !Image) resolve(src);
if (typeof window === 'undefined' || typeof Image !== 'function') resolve(src);
const img = new Image();
img.onload = () => {
resolve(src);
Expand Down

0 comments on commit 9665cc6

Please sign in to comment.