helloadhavan/github_issues huggingface dataset:
Repository: denoland/deno
Pull request: feat(task): turn off failglob by default

* https://github.com/denoland/deno_task_shell/pull/168

This is technically a breaking change, but should mostly be ok because it means less stuff will error by default.

It can be turned back on with `shopt -s failglob`.

Closes https://github.com/denoland/deno/issues/31936

Changed files:
filename: Cargo.lock
patch: @@ -3026,9 +3026,9 @@ dependencies = [
 
 [[package]]
 name = "deno_task_shell"
-version = "0.28.0"
+version = "0.29.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "078f9f536187d5bdf536104c139aeb49d23a3bbc2b6f23626fa04487bd819615"
+checksum = "29499442dc26a6c025b29beb9ba889d9fd6c9bbbd28a65eab25031c935965846"
 dependencies = [
  "anyhow",
  "bitflags 2.9.3",

filename: Cargo.toml
patch: @@ -87,7 +87,7 @@ deno_media_type = { version = "=0.4.0", features = ["module_specifier"] }
 deno_native_certs = "0.3.0"
 deno_path_util = "=0.6.4"
 deno_semver = "=0.9.1"
-deno_task_shell = "=0.28.0"
+deno_task_shell = "=0.29.0"
 deno_terminal = "=0.2.3"
 deno_unsync = { version = "0.4.4", default-features = false }
 deno_whoami = "0.1.0"
Repository: facebook/react
Pull request: [compiler] Add babel-plugin-idx to snap

Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* #30435
* __->__ #30434

To surface any potential conflicts with this plugin, let's install it
into snap so we can surface any runtime errors after compilation

Changed files:
filename: compiler/packages/snap/package.json
patch: @@ -24,6 +24,7 @@
     "@babel/preset-typescript": "^7.18.6",
     "@parcel/watcher": "^2.1.0",
     "@testing-library/react": "^13.4.0",
+    "babel-plugin-idx": "^3.0.3",
     "babel-plugin-syntax-hermes-parser": "^0.15.1",
     "chalk": "4",
     "fbt": "^1.0.0",

filename: compiler/packages/snap/src/compiler.ts
patch: @@ -250,7 +250,11 @@ function getEvaluatorPresets(
 ): Array<BabelCore.PluginItem> {
   const presets: Array<BabelCore.PluginItem> = [
     {
-      plugins: ['babel-plugin-fbt', 'babel-plugin-fbt-runtime'],
+      plugins: [
+        'babel-plugin-fbt',
+        'babel-plugin-fbt-runtime',
+        'babel-plugin-idx',
+      ],
     },
   ];
   presets.push(
@@ -365,6 +369,7 @@ export async function transformFixtureInput(
       [plugin, options],
       'babel-plugin-fbt',
       'babel-plugin-fbt-runtime',
+      'babel-plugin-idx',
     ],
     sourceType: 'module',
     ast: includeEvaluator,

filename: compiler/yarn.lock
patch: @@ -3768,6 +3768,11 @@ babel-plugin-fbt@^1.0.0:
     nullthrows "^1.1.1"
     yargs "^15.3.1"
 
+babel-plugin-idx@^3.0.3:
+  version "3.0.3"
+  resolved "https://registry.yarnpkg.com/babel-plugin-idx/-/babel-plugin-idx-3.0.3.tgz#326d25772210a40ff7fc63eee7f3ed239e8dc9ed"
+  integrity sha512-05baCoIGsvZJKemq6KQ4KVFlweEpY4aSY56wk3W781JxCNW3u0KfBElBt26/cPZbHkjF1mnwGIOlFY+9I/VOZA==
+
 babel-plugin-istanbul@^6.1.1:
   version "6.1.1"
   resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73"
Repository: electron/electron
Pull request: feat: expose `win.isContentProtected()`

Backport of #47242

See that PR for details.


Notes: Exposed `win.isContentProtected()` to allow developers to check window protection status.


Changed files:
filename: docs/api/base-window.md
patch: @@ -1346,6 +1346,10 @@ On Windows it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`.
 For Windows 10 version 2004 and up the window will be removed from capture entirely,
 older Windows versions behave as if `WDA_MONITOR` is applied capturing a black window.
 
+#### `win.isContentProtected()` _macOS_ _Windows_
+
+Returns `boolean` - whether or not content protection is currently enabled.
+
 #### `win.setFocusable(focusable)` _macOS_ _Windows_
 
 * `focusable` boolean

filename: docs/api/browser-window.md
patch: @@ -1528,6 +1528,10 @@ On Windows it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`.
 For Windows 10 version 2004 and up the window will be removed from capture entirely,
 older Windows versions behave as if `WDA_MONITOR` is applied capturing a black window.
 
+#### `win.isContentProtected()` _macOS_ _Windows_
+
+Returns `boolean` - whether or not content protection is currently enabled.
+
 #### `win.setFocusable(focusable)` _macOS_ _Windows_
 
 * `focusable` boolean

filename: shell/browser/api/electron_api_base_window.cc
patch: @@ -1261,7 +1261,7 @@ void BaseWindow::BuildPrototype(v8::Isolate* isolate,
       .SetMethod("isDocumentEdited", &BaseWindow::IsDocumentEdited)
       .SetMethod("setIgnoreMouseEvents", &BaseWindow::SetIgnoreMouseEvents)
       .SetMethod("setContentProtection", &BaseWindow::SetContentProtection)
-      .SetMethod("_isContentProtected", &BaseWindow::IsContentProtected)
+      .SetMethod("isContentProtected", &BaseWindow::IsContentProtected)
       .SetMethod("setFocusable", &BaseWindow::SetFocusable)
       .SetMethod("isFocusable", &BaseWindow::IsFocusable)
       .SetMethod("setMenu", &BaseWindow::SetMenu)

filename: spec/api-browser-window-spec.ts
patch: @@ -300,17 +300,15 @@ describe('BrowserWindow module', () => {
     afterEach(closeAllWindows);
     it('can set content protection', async () => {
       const w = new BrowserWindow({ show: false });
-      // @ts-expect-error This is a private API
-      expect(w._isContentProtected()).to.equal(false);
+      expect(w.isContentProtected()).to.equal(false);
 
       const shown = once(w, 'show');
 
       w.show();
       await shown;
 
       w.setContentProtection(true);
-      // @ts-expect-error This is a private API
-      expect(w._isContentProtected()).to.equal(true);
+      expect(w.isContentProtected()).to.equal(true);
     });
 
     it('does not remove content protection after the window is hidden and shown', async () => {
@@ -329,8 +327,7 @@ describe('BrowserWindow module', () => {
       w.show();
       await shown;
 
-      // @ts-expect-error This is a private API
-      expect(w._isContentProtected()).to.equal(true);
+      expect(w.isContentProtected()).to.equal(true);
     });
   });
Repository: ollama/ollama
Pull request: Better tmpdir cleanup

If expanding the runners fails, don't leave a corrupt/incomplete payloads dir. We now write a pid file out to the tmpdir, which allows us to scan for stale tmpdirs and remove this as long as there isn't still a process running.

Fixes #3051 
Fixes #2472 
Fixes #2658  (indirectly)

Verified on Mac, Linux and Windows.

Changed files:
filename: gpu/assets.go
patch: @@ -1,13 +1,16 @@
 package gpu
 
 import (
+	"errors"
 	"fmt"
 	"log/slog"
 	"os"
 	"path/filepath"
 	"runtime"
+	"strconv"
 	"strings"
 	"sync"
+	"syscall"
 )
 
 var (
@@ -19,17 +22,59 @@ func PayloadsDir() (string, error) {
 	lock.Lock()
 	defer lock.Unlock()
 	if payloadsDir == "" {
+		cleanupTmpDirs()
 		tmpDir, err := os.MkdirTemp("", "ollama")
 		if err != nil {
 			return "", fmt.Errorf("failed to generate tmp dir: %w", err)
 		}
+
+		// Track our pid so we can clean up orphaned tmpdirs
+		pidFilePath := filepath.Join(tmpDir, "ollama.pid")
+		pidFile, err := os.OpenFile(pidFilePath, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, os.ModePerm)
+		if err != nil {
+			return "", err
+		}
+		if _, err := pidFile.Write([]byte(fmt.Sprint(os.Getpid()))); err != nil {
+			return "", err
+		}
+
 		// We create a distinct subdirectory for payloads within the tmpdir
 		// This will typically look like /tmp/ollama3208993108/runners on linux
 		payloadsDir = filepath.Join(tmpDir, "runners")
 	}
 	return payloadsDir, nil
 }
 
+// Best effort to clean up prior tmpdirs
+func cleanupTmpDirs() {
+	dirs, err := filepath.Glob(filepath.Join(os.TempDir(), "ollama*"))
+	if err != nil {
+		return
+	}
+	for _, d := range dirs {
+		info, err := os.Stat(d)
+		if err != nil || !info.IsDir() {
+			continue
+		}
+		raw, err := os.ReadFile(filepath.Join(d, "ollama.pid"))
+		if err == nil {
+			pid, err := strconv.Atoi(string(raw))
+			if err == nil {
+				if proc, err := os.FindProcess(int(pid)); err == nil && !errors.Is(proc.Signal(syscall.Signal(0)), os.ErrProcessDone) {
+					// Another running ollama, ignore this tmpdir
+					continue
+				}
+			}
+		} else {
+			slog.Debug("failed to open ollama.pid", "path", d, "error", err)
+		}
+		err = os.RemoveAll(d)
+		if err != nil {
+			slog.Debug(fmt.Sprintf("unable to cleanup stale tmpdir %s: %s", d, err))
+		}
+	}
+}
+
 func Cleanup() {
 	lock.Lock()
 	defer lock.Unlock()

filename: llm/payload_common.go
patch: @@ -196,7 +196,13 @@ func extractDynamicLibs(payloadsDir, glob string) ([]string, error) {
 			return nil
 		})
 	}
-	return libs, g.Wait()
+	err = g.Wait()
+	if err != nil {
+		// If we fail to extract, the payload dir is unusable, so cleanup whatever we extracted
+		gpu.Cleanup()
+		return nil, err
+	}
+	return libs, nil
 }
 
 func verifyDriverAccess() error {
Repository: nodejs/node
Pull request: doc: add security incident reponse plan

This document should provide the right direction in the event of a security incident (as it was from a recent GitHub UI change that exposes the "settings")

Changed files:
filename: SECURITY.md
patch: @@ -284,3 +284,8 @@ Security notifications will be distributed via the following methods.
 If you have suggestions on how this process could be improved, please visit
 the [nodejs/security-wg](https://github.com/nodejs/security-wg)
 repository.
+
+## Incident Response Plan
+
+In the event of a security incident, please refer to the
+[Security Incident Response Plan](https://github.com/nodejs/security-wg/blob/main/INCIDENT_RESPONSE_PLAN.md).
Repository: facebook/react
Pull request: [compiler][repro] Test fixture for fbt whitespace bug

Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* #30423
* __->__ #30394



Changed files:
filename: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/bug-fbt-preserve-whitespace-param.expect.md
patch: @@ -2,7 +2,7 @@
 ## Input
 
 ```javascript
-import fbt from "fbt";
+import fbt from 'fbt';
 
 /**
  * Currently fails with the following:
@@ -32,7 +32,7 @@ function Foo(props) {
 
 export const FIXTURE_ENTRYPOINT = {
   fn: Foo,
-  params: [{ name: "Jason" }],
+  params: [{name: 'Jason'}],
 };
 
 ```

filename: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/bug-fbt-preserve-whitespace-param.tsx
patch: @@ -1,4 +1,4 @@
-import fbt from "fbt";
+import fbt from 'fbt';
 
 /**
  * Currently fails with the following:
@@ -28,5 +28,5 @@ function Foo(props) {
 
 export const FIXTURE_ENTRYPOINT = {
   fn: Foo,
-  params: [{ name: "Jason" }],
+  params: [{name: 'Jason'}],
 };
Repository: vercel/next.js
Pull request: Turbopack: Remove not-very-useful "Finished writing to disk in" log line

We've received feedback that this log line is more confusing than useful.

In the future, we'd like to show this, but in a more clear and structured way, along with other metrics for other parts of the build.

Closes PACK-5583

Changed files:
filename: crates/napi/src/next_api/project.rs
patch: @@ -34,7 +34,7 @@ use turbo_rcstr::{RcStr, rcstr};
 use turbo_tasks::{
     Effects, FxIndexSet, NonLocalValue, OperationValue, OperationVc, ReadRef, ResolvedVc,
     TaskInput, TransientInstance, TryJoinIterExt, TurboTasksApi, UpdateInfo, Vc, get_effects,
-    message_queue::{CompilationEvent, Severity, TimingEvent},
+    message_queue::{CompilationEvent, Severity},
     trace::TraceRawVcs,
 };
 use turbo_tasks_backend::{BackingStorage, db_invalidation::invalidation_reasons};
@@ -892,7 +892,6 @@ pub async fn project_write_all_entrypoints_to_disk(
     let ctx = &project.turbopack_ctx;
     let container = project.container;
     let tt = ctx.turbo_tasks();
-    let tt_clone = tt.clone();
 
     let (entrypoints, issues, diags) = tt
         .run(async move {
@@ -909,18 +908,9 @@ pub async fn project_write_all_entrypoints_to_disk(
                 .read_strongly_consistent()
                 .await?;
 
-            // Start timing writing the files to disk
-            let now = Instant::now();
-
             // Write the files to disk
             effects.apply().await?;
 
-            // Send a compilation event to indicate that the files have been written to disk
-            tt_clone.send_compilation_event(Arc::new(TimingEvent::new(
-                "Finished writing to disk".to_owned(),
-                now.elapsed(),
-            )));
-
             Ok((entrypoints.clone(), issues.clone(), diagnostics.clone()))
         })
         .or_else(|e| ctx.throw_turbopack_internal_result(&e.into()))
Repository: huggingface/transformers
Pull request: feat: use `aws-highcpu-32-priv` for amd docker img build

change the runner group to something more powerful, amd docker image build is very greedy in resources

Changed files:
filename: .github/workflows/build-docker-images.yml
patch: @@ -5,6 +5,7 @@ on:
     branches:
       - build_ci_docker_image*
   repository_dispatch:
+  workflow_dispatch:
   workflow_call:
     inputs:
       image_postfix:
@@ -221,7 +222,7 @@ jobs:
   latest-pytorch-amd:
     name: "Latest PyTorch (AMD) [dev]"
     runs-on:
-      group: aws-general-8-plus
+      group: aws-highcpu-32-priv
     steps:
       -
         name: Set up Docker Buildx
Repository: ollama/ollama
Pull request: remove global

the global isn't being used

Changed files:
filename: llm/dyn_ext_server.go
patch: @@ -64,9 +64,6 @@ func extServerResponseToErr(resp C.ext_server_resp_t) error {
 	return fmt.Errorf(C.GoString(resp.msg))
 }
 
-// Note: current implementation does not support concurrent instantiations
-var llm *dynExtServer
-
 func newDynExtServer(library, model string, adapters, projectors []string, opts api.Options) (LLM, error) {
 	if !mutex.TryLock() {
 		slog.Info("concurrent llm servers not yet supported, waiting for prior server to complete")
@@ -83,7 +80,7 @@ func newDynExtServer(library, model string, adapters, projectors []string, opts
 		mutex.Unlock()
 		return nil, fmt.Errorf("Unable to load dynamic library: %s", C.GoString(resp.msg))
 	}
-	llm = &dynExtServer{
+	llm := dynExtServer{
 		s:       srv,
 		options: opts,
 	}
@@ -161,7 +158,7 @@ func newDynExtServer(library, model string, adapters, projectors []string, opts
 
 	slog.Info("Starting llama main loop")
 	C.dyn_llama_server_start(llm.s)
-	return llm, nil
+	return &llm, nil
 }
 
 func (llm *dynExtServer) Predict(ctx context.Context, predict PredictOpts, fn func(PredictResult)) error {
Repository: electron/electron
Pull request: feat: expose `win.isContentProtected()`

Backport of #47242

See that PR for details.


Notes: Exposed `win.isContentProtected()` to allow developers to check window protection status.


Changed files:
filename: docs/api/base-window.md
patch: @@ -1346,6 +1346,10 @@ On Windows it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`.
 For Windows 10 version 2004 and up the window will be removed from capture entirely,
 older Windows versions behave as if `WDA_MONITOR` is applied capturing a black window.
 
+#### `win.isContentProtected()` _macOS_ _Windows_
+
+Returns `boolean` - whether or not content protection is currently enabled.
+
 #### `win.setFocusable(focusable)` _macOS_ _Windows_
 
 * `focusable` boolean

filename: docs/api/browser-window.md
patch: @@ -1528,6 +1528,10 @@ On Windows it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`.
 For Windows 10 version 2004 and up the window will be removed from capture entirely,
 older Windows versions behave as if `WDA_MONITOR` is applied capturing a black window.
 
+#### `win.isContentProtected()` _macOS_ _Windows_
+
+Returns `boolean` - whether or not content protection is currently enabled.
+
 #### `win.setFocusable(focusable)` _macOS_ _Windows_
 
 * `focusable` boolean

filename: shell/browser/api/electron_api_base_window.cc
patch: @@ -1260,7 +1260,7 @@ void BaseWindow::BuildPrototype(v8::Isolate* isolate,
       .SetMethod("isDocumentEdited", &BaseWindow::IsDocumentEdited)
       .SetMethod("setIgnoreMouseEvents", &BaseWindow::SetIgnoreMouseEvents)
       .SetMethod("setContentProtection", &BaseWindow::SetContentProtection)
-      .SetMethod("_isContentProtected", &BaseWindow::IsContentProtected)
+      .SetMethod("isContentProtected", &BaseWindow::IsContentProtected)
       .SetMethod("setFocusable", &BaseWindow::SetFocusable)
       .SetMethod("isFocusable", &BaseWindow::IsFocusable)
       .SetMethod("setMenu", &BaseWindow::SetMenu)

filename: spec/api-browser-window-spec.ts
patch: @@ -300,17 +300,15 @@ describe('BrowserWindow module', () => {
     afterEach(closeAllWindows);
     it('can set content protection', async () => {
       const w = new BrowserWindow({ show: false });
-      // @ts-expect-error This is a private API
-      expect(w._isContentProtected()).to.equal(false);
+      expect(w.isContentProtected()).to.equal(false);
 
       const shown = once(w, 'show');
 
       w.show();
       await shown;
 
       w.setContentProtection(true);
-      // @ts-expect-error This is a private API
-      expect(w._isContentProtected()).to.equal(true);
+      expect(w.isContentProtected()).to.equal(true);
     });
 
     it('does not remove content protection after the window is hidden and shown', async () => {
@@ -329,8 +327,7 @@ describe('BrowserWindow module', () => {
       w.show();
       await shown;
 
-      // @ts-expect-error This is a private API
-      expect(w._isContentProtected()).to.equal(true);
+      expect(w.isContentProtected()).to.equal(true);
     });
   });
Repository: vercel/next.js
Pull request: [mcp] allow to enable mcp server through env var

Allow you to enable experimental mcpServer feature through env var

Changed files:
filename: packages/next/src/server/config-shared.ts
patch: @@ -1516,6 +1516,7 @@ export const defaultConfig = Object.freeze({
     browserDebugInfoInTerminal: false,
     isolatedDevBuild:
       process.env.__NEXT_EXPERIMENTAL_ISOLATED_DEV_BUILD === 'true',
+    mcpServer: !!process.env.__NEXT_EXPERIMENTAL_MCP_SERVER,
   },
   htmlLimitedBots: undefined,
   bundlePagesRouterDependencies: false,
Repository: nodejs/node
Pull request: test: mark web lock held test as flaky

Refs: https://github.com/nodejs/node/issues/59142

Changed files:
filename: test/wpt/status/web-locks.json
patch: @@ -1,4 +1,12 @@
 {
+  "held.https.any.js": {
+    "fail": {
+      "note": "Flaky on ppc, linux x64 and s390x #59142",
+      "flaky": [
+        "evaluation in WPTRunner.runJsTests()"
+      ]
+    }
+  },
   "idlharness.https.any.js": {
     "fail": {
       "expected": [
Repository: facebook/react
Pull request: Add _debugStack and _debugTask under enableObjectFiber flag


Changed files:
filename: packages/react-reconciler/src/ReactFiber.js
patch: @@ -296,11 +296,15 @@ function createFiberImplObject(
   }
 
   if (__DEV__) {
+    // This isn't directly used but is handy for debugging internals:
     fiber._debugInfo = null;
     fiber._debugOwner = null;
+    if (enableOwnerStacks) {
+      fiber._debugStack = null;
+      fiber._debugTask = null;
+    }
     fiber._debugNeedsRemount = false;
     fiber._debugHookTypes = null;
-
     if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {
       Object.preventExtensions(fiber);
     }
Repository: vercel/next.js
Pull request: fix(metadata): make formatDetection respect true/false properly

### What?

Fixes the `FormatDetectionMeta` function so that it correctly respects true vs false values.

### Why?

Previously, both true and false values output key=no. According to Apple’s spec, Safari defaults to enabling detection when the tag is absent, and only no should be added when explicitly disabled.

### How?

- Now false → outputs key=no
- true → omits the tag (defaults to Safari’s behavior)

### Reference

-  [Apple docs on format-detection](https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html#//apple_ref/doc/uid/TP40008193-SW1)

Fixes #83666 

Changed files:
filename: packages/next/src/lib/metadata/generate/basic.tsx
patch: @@ -184,12 +184,12 @@ export function FormatDetectionMeta({
   if (!formatDetection) return null
   let content = ''
   for (const key of formatDetectionKeys) {
-    if (key in formatDetection) {
+    if (formatDetection[key] === false) {
       if (content) content += ', '
       content += `${key}=no`
     }
   }
-  return <meta name="format-detection" content={content} />
+  return content ? <meta name="format-detection" content={content} /> : null
 }
 
 export function AppleWebAppMeta({

filename: test/e2e/app-dir/metadata/app/basic/page.tsx
patch: @@ -37,6 +37,8 @@ export const metadata: Metadata = {
     email: false,
     address: false,
     telephone: false,
+    // Properties set to `true` should not be included in `format-detection` meta tag
+    url: true,
   },
 }
Repository: nodejs/node
Pull request: repl: fix repl crashing on variable declarations without init

Fixes: https://github.com/nodejs/node/issues/59029

<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: lib/repl.js
patch: @@ -1735,6 +1735,10 @@ function findExpressionCompleteTarget(code) {
   // what we can potentially complete on, so let's re-run the function's logic on that
   if (lastBodyStatement.type === 'VariableDeclaration') {
     const lastDeclarationInit = lastBodyStatement.declarations.at(-1).init;
+    if (!lastDeclarationInit) {
+      // If there is no initialization we can simply return
+      return null;
+    }
     const lastDeclarationInitCode = code.slice(lastDeclarationInit.start, lastDeclarationInit.end);
     return findExpressionCompleteTarget(lastDeclarationInitCode);
   }

filename: test/parallel/test-repl-tab-complete.js
patch: @@ -50,6 +50,12 @@ function prepareREPL() {
 }
 
 describe('REPL tab completion (core functionality)', () => {
+  it('does not break with variable declarations without an initialization', () => {
+    const { replServer } = prepareREPL();
+    replServer.complete('let a', getNoResultsFunction());
+    replServer.close();
+  });
+
   it('does not break in an object literal', () => {
     const { replServer, input } = prepareREPL();