Skip to content

Typing import(""). locks up node repl and gets caught in a error loop #64523

Description

@BlankParticle

Version

v26.5.0

Platform

Darwin Yoru.local 27.0.0 Darwin Kernel Version 27.0.0: Mon Jun 29 21:25:02 PDT 2026; root:xnu-13432.0.50.501.3~1/RELEASE_ARM64_T6041 arm64

Subsystem

repl

What steps will reproduce the bug?

  1. type node to start the node repl
  2. type import(""). or any non existent module
  3. Watch your repl get locked up and hundreds of module not found errors starts filling up your terminal

How often does it reproduce? Is there a required condition?

Always, tested in node v24 and v26, typing or pasting both works

What is the expected behavior? Why is that the expected behavior?

Repl is trying to import the module to evaluate the object for completion, but the module doesn't exist which causes errors to fill up the terminal

the error should be properly captured and show up in the predictive area like in this screenshot

Image

What do you see instead?

The console starts filling up with

> Uncaught:).
Error: Cannot find package '/Users/blank/Projects/BlankParticle/node_modules/index.js' imported from /Users/blank/Projects/BlankParticle/repl
    at legacyMainResolve (node:internal/modules/esm/resolve:202:26)
    at packageResolve (node:internal/modules/esm/resolve:796:12)
    at moduleResolve (node:internal/modules/esm/resolve:873:18)
    at defaultResolve (node:internal/modules/esm/resolve:1006:11)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:708:20)
    at #resolveAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:728:38)
    at ModuleLoader.resolveSync (node:internal/modules/esm/loader:766:56)
    at #resolve (node:internal/modules/esm/loader:690:17)
    at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:610:35) {
  code: 'ERR_MODULE_NOT_FOUND'
}

and it locks up the entire repl, ctrl C works to kill the repl, but sometimes you need to kill the process from another console

Screen.Recording.2026-07-15.at.22.53.21.mov

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions