Skip to content

Commit 96b633a

Browse files
committed
fix: import cross-fetch conditionally
1 parent 30fb572 commit 96b633a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/lib/helpers.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import crossFetch from 'cross-fetch'
21
import { SupportedStorage } from './types'
32

43
export function expiresAt(expiresIn: number) {
@@ -34,7 +33,7 @@ export const resolveFetch = (customFetch?: Fetch): Fetch => {
3433
if (customFetch) {
3534
_fetch = customFetch
3635
} else if (typeof fetch === 'undefined') {
37-
_fetch = crossFetch as unknown as Fetch
36+
_fetch = async (...args) => await (await import('cross-fetch')).fetch(...args)
3837
} else {
3938
_fetch = fetch
4039
}

0 commit comments

Comments
 (0)