Skip to content

Commit 3328ee9

Browse files
committed
Remove conditionnal loading for fetch polyfill
1 parent f2ef0d2 commit 3328ee9

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/errors/meilisearch-communication-error.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'cross-fetch/polyfill'
12
import { FetchError } from '../types'
23

34
class MeiliSearchCommunicationError extends Error {

src/http-requests.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'cross-fetch/polyfill'
2+
13
import { Config, EnqueuedTaskObject } from './types'
24
import { PACKAGE_VERSION } from './package-version'
35

@@ -118,10 +120,6 @@ class HttpRequests {
118120
body?: any
119121
config?: Record<string, any>
120122
}) {
121-
if (typeof fetch === 'undefined') {
122-
require('cross-fetch/dist/node-polyfill')
123-
}
124-
125123
const constructURL = new URL(url, this.url)
126124
if (params) {
127125
const queryParams = new URLSearchParams()

0 commit comments

Comments
 (0)