Skip to content

Commit 875c935

Browse files
committed
fix: import cross-fetch conditionally
1 parent d27bf34 commit 875c935

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/lib/types.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import crossFetch from 'cross-fetch'
2-
31
export type Fetch = typeof fetch
42

53
/**
@@ -67,7 +65,7 @@ export abstract class PostgrestBuilder<T> implements PromiseLike<PostgrestRespon
6765
if (builder.fetch) {
6866
_fetch = builder.fetch
6967
} else if (typeof fetch === 'undefined') {
70-
_fetch = crossFetch
68+
_fetch = async (...args) => await (await import('cross-fetch')).fetch(...args)
7169
} else {
7270
_fetch = fetch
7371
}

0 commit comments

Comments
 (0)