Skip to content

on-finished fails on Node.js 26 #1176

Description

@MikeMcC399

Situation

Running citgm on-finished fails in Node.js 26

ReferenceError: require is not defined in ES module scope, you can use import instead
Item Status
npm package https://www.npmjs.com/package/on-finished
npm status not deprecated
last published 2.4.1 Feb 22, 2022
weekly downloads 146,298,987
repo location https://github.com/jshttp/on-finished
repo last update to default branch Dec 2, 2025
repo status stable
repo CI status runs in Node.js <=24
lookup - skip -
lookup maintainer 1 wesleytodd

Repo CI https://github.com/jshttp/on-finished/blob/master/.github/workflows/ci.yml runs in Node.js <=24 on ubuntu

Cloning the repo and running local tests using Ubuntu 26.04.1 LTS and running under Node.js 22, 24 & 26 confirm the compatibility issues for Node.js 26.

Steps to reproduce

Run https://github.com/nodejs/citgm/actions/workflows/test-module.yml

Module to test: on-finished
CITGM repository to checkout: nodejs/citgm
CITGM GitHub ref to checkout: main

Result

Fails in Node.js 26:

Node.js npm macos ubuntu windows
22.23.3 10.9.9 PASS PASS PASS
24.21.0 11.19.0 PASS PASS PASS
26.10.0 11.19.1 FAIL FAIL FAIL

References

citgm/lib/lookup.json

Lines 328 to 330 in 4d3d256

"on-finished": {
"maintainers": "wesleytodd"
},

cc: @wesleytodd

Activity

  1. MikeMcC399 commented on Oct 6, 2026

    @MikeMcC399
    ContributorAuthor

    Suggestion

    Maintainers of https://github.com/jshttp/on-finished should consider updating to mocha@>=11 and cutting a new release to enable npm test to pass under Node.js 26.

  2. MikeMcC399 commented on Oct 9, 2026

    @MikeMcC399
    ContributorAuthor

    jshttp/on-finished#103 is attempting to resolve this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions