Skip to content

Commit

Permalink
fix: revert using @supabase/node-fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
soedirgo committed Aug 23, 2023
1 parent d7b7eaf commit be421d9
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 24 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 @@ -35,7 +35,7 @@
"db:run": "cd test/db && docker-compose up --detach && wait-for-localhost 3000"
},
"dependencies": {
"@supabase/node-fetch": "^2.6.13"
"cross-fetch": "^3.1.8"
},
"devDependencies": {
"@types/jest": "^27.5.1",
Expand Down
5 changes: 2 additions & 3 deletions src/PostgrestBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @ts-ignore
import nodeFetch from '@supabase/node-fetch'
import crossFetch from 'cross-fetch'

import type { Fetch, PostgrestSingleResponse } from './types'

Expand Down Expand Up @@ -29,7 +28,7 @@ export default abstract class PostgrestBuilder<Result>
if (builder.fetch) {
this.fetch = builder.fetch
} else if (typeof fetch === 'undefined') {
this.fetch = nodeFetch
this.fetch = crossFetch
} else {
this.fetch = fetch
}
Expand Down

0 comments on commit be421d9

Please sign in to comment.