Skip to content

repl: fix eval errors thrown after close throwing ERR_USE_AFTER_CLOSE - #58791

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
dario-piotrowicz:dario/58784/repl-error-after-close-fix
Jun 28, 2025
Merged

repl: fix eval errors thrown after close throwing ERR_USE_AFTER_CLOSE#58791
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
dario-piotrowicz:dario/58784/repl-error-after-close-fix

Conversation

@dario-piotrowicz

Copy link
Copy Markdown
Member

Fixes#58784

prevent incorrect throws of ERR_USE_AFTER_CLOSE errors when the eval function of a repl server returns an error after the repl server has been closed

prevent incorrect throws of `ERR_USE_AFTER_CLOSE` errors when the eval
function of a repl server returns an error after the repl server
has been closed
@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. repl Issues and PRs related to the REPL subsystem. labels Jun 22, 2025
@codecov

codecovBot commented Jun 22, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.09%. Comparing base (d7becc5) to head (6851671).
Report is 44 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #58791 +/- ##
==========================================
- Coverage 90.10% 90.09% -0.01% 
==========================================
Files 640 640 Lines 188287 188291 +4 Branches 36916 36926 +10 ==========================================
- Hits 169651 169636 -15 - Misses 11355 11385 +30 + Partials 7281 7270 -11 
Files with missing linesCoverage Δ
lib/repl.js94.88% <100.00%> (+0.01%)⬆️

... and 28 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lpincalpinca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSLGMT

@lpincalpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 22, 2025
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 22, 2025
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@hildjj

Copy link
Copy Markdown

I have confirmed that this patch fixes my issue.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@dario-piotrowiczdario-piotrowicz added the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 28, 2025
@nodejs-github-botnodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Jun 28, 2025
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
node:internal/modules/esm/resolve:275
throw new ERR_MODULE_NOT_FOUND(
^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/css-what/dist/esm/index.js' imported from /opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/cheerio-select/lib/esm/index.js
at finalizeResolution (node:internal/modules/esm/resolve:275:11)
at moduleResolve (node:internal/modules/esm/resolve:860:10)
at defaultResolve (node:internal/modules/esm/resolve:984:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:780:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:704:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:687:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:305:38)
at ModuleJob._link (node:internal/modules/esm/module_job:137:49) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/css-what/dist/esm/index.js'
}

Node.js v22.16.0

https://github.com/nodejs/node/actions/runs/15943283499

@aduh95aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Jun 28, 2025
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 28, 2025
@nodejs-github-bot
nodejs-github-bot merged commit 9fe3316 into nodejs:mainJun 28, 2025
53 of 54 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 9fe3316

@dario-piotrowicz
dario-piotrowicz deleted the dario/58784/repl-error-after-close-fix branch June 28, 2025 22:36
targos pushed a commit that referenced this pull request Jul 3, 2025
prevent incorrect throws of `ERR_USE_AFTER_CLOSE` errors when the eval
function of a repl server returns an error after the repl server
has been closed
PR-URL: #58791
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
aduh95 pushed a commit that referenced this pull request Jul 21, 2025
prevent incorrect throws of `ERR_USE_AFTER_CLOSE` errors when the eval
function of a repl server returns an error after the repl server
has been closed
PR-URL: #58791
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
aduh95 pushed a commit that referenced this pull request Jul 24, 2025
prevent incorrect throws of `ERR_USE_AFTER_CLOSE` errors when the eval
function of a repl server returns an error after the repl server
has been closed
PR-URL: #58791
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.needs-ciPRs that need a full CI run.replIssues and PRs related to the REPL subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ERR_USE_AFTER_CLOSE in repl with async eval

6 participants

@dario-piotrowicz@nodejs-github-bot@hildjj@lpinca@BridgeAR@aduh95