From e0c6c4963194c5f3c2d8cf5309b0b3e85a2b5d69 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Thu, 6 Nov 2025 16:34:43 +0100 Subject: [PATCH 1/3] refactor: simplify the remote patterns config (#8325) --- apps/site/next.config.mjs | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/apps/site/next.config.mjs b/apps/site/next.config.mjs index 7396448b79b18..f73ff9aceb00b 100644 --- a/apps/site/next.config.mjs +++ b/apps/site/next.config.mjs @@ -19,36 +19,11 @@ const nextConfig = { // We add it to the remote pattern for the static images we use from multiple sources // to be marked as safe sources (these come from Markdown files) remotePatterns: [ - { - protocol: 'https', - hostname: 'avatars.githubusercontent.com', - port: '', - pathname: '/**', - }, - { - protocol: 'https', - hostname: 'bestpractices.coreinfrastructure.org', - port: '', - pathname: '/**', - }, - { - protocol: 'https', - hostname: 'raw.githubusercontent.com', - port: '', - pathname: '/nodejs/**', - }, - { - protocol: 'https', - hostname: 'user-images.githubusercontent.com', - port: '', - pathname: '/**', - }, - { - protocol: 'https', - hostname: 'website-assets.oramasearch.com', - port: '', - pathname: '/**', - }, + new URL('https://avatars.githubusercontent.com/**'), + new URL('https://bestpractices.coreinfrastructure.org/**'), + new URL('https://raw.githubusercontent.com/nodejs/**'), + new URL('https://user-images.githubusercontent.com/**'), + new URL('https://website-assets.oramasearch.com/**'), ], }, serverExternalPackages: ['twoslash'], From e2b6839eeb0294e1623ae1550876b8486004b9c4 Mon Sep 17 00:00:00 2001 From: Efe Date: Thu, 6 Nov 2025 16:37:36 +0100 Subject: [PATCH 2/3] docs(learn): improve debugging docs (#8329) * docs(learn): improve debugging docs * docs(learn): remove gitpod section * docs(learn): update vscode link * Update apps/site/pages/en/learn/getting-started/debugging.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Efe * docs(learn): update debugging docs according to copilot suggestions --------- Signed-off-by: Efe Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../en/learn/getting-started/debugging.md | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/apps/site/pages/en/learn/getting-started/debugging.md b/apps/site/pages/en/learn/getting-started/debugging.md index d68bdbe6322ef..7e7cc7da59337 100644 --- a/apps/site/pages/en/learn/getting-started/debugging.md +++ b/apps/site/pages/en/learn/getting-started/debugging.md @@ -71,20 +71,25 @@ Several commercial and open source tools can also connect to the Node.js Inspect ### Chrome DevTools 55+, Microsoft Edge -- **Option 1**: Open `chrome://inspect` in a Chromium-based - browser or `edge://inspect` in Edge. Click the Configure button and ensure your target host and port - are listed. -- **Option 2**: Copy the `devtoolsFrontendUrl` from the output of `/json/list` - (see above) or the --inspect hint text and paste into Chrome. +#### Option 1: Use the built-in DevTools UI -See https://github.com/ChromeDevTools/devtools-frontend, https://www.microsoftedgeinsider.com for more information. +- Open `chrome://inspect` (`edge://inspect` in Microsoft Edge) in your browser. +- Click the Configure button and ensure your target host and port are listed. +- Your Node.js application should appear in the Remote Target list. + +#### Option 2: Connect manually + +- Visit `http://localhost:/json/list`. It should return a JSON object containing a `devtoolsFrontendUrl`. +- Copy the `devtoolsFrontendUrl` value from the response and paste it into your browser's address bar. + +See [Chrome DevTools Frontend](https://github.com/ChromeDevTools/devtools-frontend) and [Microsoft Edge DevTools Guide](https://learn.microsoft.com/microsoft-edge/devtools-guide-chromium/) for more information. ### Visual Studio Code 1.10+ - In the Debug panel, click the settings icon to open `.vscode/launch.json`. Select "Node.js" for initial setup. -See https://github.com/microsoft/vscode for more information. +See https://code.visualstudio.com/docs/nodejs/nodejs-debugging for more information. ### Visual Studio 2017+ @@ -104,18 +109,12 @@ See https://github.com/microsoft/vscode for more information. See https://github.com/cyrus-and/chrome-remote-interface for more information. -### Gitpod - -- Start a Node.js debug configuration from the `Debug` view or hit `F5`. [Detailed instructions](https://medium.com/gitpod/debugging-node-js-applications-in-theia-76c94c76f0a1) - -See https://www.gitpod.io for more information. - ### Eclipse IDE with Eclipse Wild Web Developer extension - From a .js file, choose "Debug As... > Node program", or - Create a Debug Configuration to attach debugger to running Node.js application (already started with `--inspect`). -See https://eclipse.org/eclipseide for more information. +See https://eclipseide.org/ for more information. ## Command-line options From 15921e133984d8e728fbab5b01068373ca6fe3ec Mon Sep 17 00:00:00 2001 From: "N. Bighetti" <60653216+tenkirin@users.noreply.github.com> Date: Fri, 7 Nov 2025 00:37:46 +0900 Subject: [PATCH 3/3] docs(learn): correct another example code for the consumption of response body (#8332) --- .../en/learn/manipulating-files/reading-files-with-nodejs.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/site/pages/en/learn/manipulating-files/reading-files-with-nodejs.md b/apps/site/pages/en/learn/manipulating-files/reading-files-with-nodejs.md index 24735b2f375c0..58141b91ec27c 100644 --- a/apps/site/pages/en/learn/manipulating-files/reading-files-with-nodejs.md +++ b/apps/site/pages/en/learn/manipulating-files/reading-files-with-nodejs.md @@ -101,6 +101,8 @@ async function downloadFile(url, outputPath) { const response = await fetch(url); if (!response.ok || !response.body) { + // consuming the response body is mandatory: https://undici.nodejs.org/#/?id=garbage-collection + await response.body?.cancel(); throw new Error(`Failed to fetch ${url}. Status: ${response.status}`); }