Skip to content

Commit

Permalink
fix: revert using @supabase/node-fetch (#765)
Browse files Browse the repository at this point in the history
  • Loading branch information
soedirgo authored Aug 25, 2023
1 parent a86f07d commit 22923e7
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 25 deletions.
64 changes: 44 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"docs:json": "typedoc --json docs/v2/spec.json --excludeExternals --excludePrivate --excludeProtected src/index.ts"
},
"dependencies": {
"@supabase/node-fetch": "^2.6.13"
"cross-fetch": "^3.1.5"
},
"devDependencies": {
"@types/faker": "^5.1.6",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const resolveFetch = (customFetch?: Fetch): Fetch => {
if (customFetch) {
_fetch = customFetch
} else if (typeof fetch === 'undefined') {
_fetch = (...args) => import('@supabase/node-fetch' as any).then(({ default: fetch }) => fetch(...args))
_fetch = async (...args) => await (await import('cross-fetch')).fetch(...args)
} else {
_fetch = fetch
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/locks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { supportsLocalStorage } from './helpers'
import { supportsLocalStorage } from "./helpers"

/**
* @experimental
Expand Down
3 changes: 1 addition & 2 deletions test/fetch.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { MockServer } from 'jest-mock-server'
// @ts-ignore
import fetch from '@supabase/node-fetch'
import fetch from 'cross-fetch'
import { AuthUnknownError, AuthApiError, AuthRetryableFetchError } from '../src/lib/errors'
import { _request } from '../src/lib/fetch'

Expand Down

0 comments on commit 22923e7

Please sign in to comment.