Skip to content

Commit

Permalink
Fix Document is not defined in Deno/Remix (#423)
Browse files Browse the repository at this point in the history
Issue reference: #420 (comment)
  • Loading branch information
mazniak authored Feb 16, 2023
1 parent 3bb965e commit 4496dd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const loadScript = (
}

stripePromise = new Promise((resolve, reject) => {
if (typeof window === 'undefined') {
if (typeof window === 'undefined' || typeof document === 'undefined') {
// Resolve to null when imported server side. This makes the module
// safe to import in an isomorphic code base.
resolve(null);
Expand Down

0 comments on commit 4496dd4

Please sign in to comment.