From fb8cf57bb79f15b25348b98f271b957add757278 Mon Sep 17 00:00:00 2001 From: Henri Date: Wed, 17 Jan 2024 15:11:51 +0100 Subject: [PATCH] Fix mistral client when using recent node "fetch" variable needs to be declared before being assigned, otherwise you get a "Uncaught ReferenceError" error --- src/client.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/client.js b/src/client.js index d0a801b..b36cf6d 100644 --- a/src/client.js +++ b/src/client.js @@ -1,5 +1,8 @@ let isNode = false; +// initializeFetch() will populate this variable with a fetch implementation +let fetch; + const VERSION = '0.0.3'; const RETRY_STATUS_CODES = [429, 500, 502, 503, 504]; const ENDPOINT = 'https://api.mistral.ai';