Skip to content

Commit e4c3b6e

Browse files
Merge #1499
1499: Remove conditionnal loading for fetch polyfill r=bidoubiwa a=bidoubiwa Fixes: #1488 Co-authored-by: Charlotte Vermandel <[email protected]>
2 parents f2ef0d2 + 3328ee9 commit e4c3b6e

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)