From 062165f888786714d305537d45c53a8dd5d2ff41 Mon Sep 17 00:00:00 2001 From: tenkirin <60653216+tenkirin@users.noreply.github.com> Date: Mon, 3 Nov 2025 16:50:15 +0900 Subject: [PATCH] docs(learn): correct the example code for the consumption of response body --- apps/site/pages/en/learn/getting-started/fetch.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/site/pages/en/learn/getting-started/fetch.md b/apps/site/pages/en/learn/getting-started/fetch.md index 26cd99cd51f70..61c0207d0072b 100644 --- a/apps/site/pages/en/learn/getting-started/fetch.md +++ b/apps/site/pages/en/learn/getting-started/fetch.md @@ -104,6 +104,8 @@ async function streamOllamaCompletion(prompt) { // You can read about HTTP status codes here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status // 200 means the request was successful. if (statusCode !== 200) { + // consuming the response body is mandatory: https://undici.nodejs.org/#/?id=garbage-collection + await body.dump(); throw new Error(`Ollama request failed with status ${statusCode}`); }