Skip to content

compression fails on Node.js 26 #1171

Open

Description

@MikeMcC399

Situation

Running citgm compression passes on Node.js 22 & 24, and fails on 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/compression
npm status active
last published 1.8.2 Sep 11, 2026
weekly downloads 53,709,840
repo location https://github.com/expressjs/compression
repo last update to default branch Sep 11, 2026
repo status active
repo CI status runs in Node.js up to 25
lookup - skip -
lookup maintainer 1 UlisesGascon
lookup maintainer 2 bjohansebas

Repo CI https://github.com/expressjs/compression/blob/master/.github/workflows/ci.yml runs a full set of EOL and current Node.js versions, except for Node.js 26.

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: compression
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 113 to 115 in 4d3d256

"compression": {
"maintainers": ["UlisesGascon", "bjohansebas"]
},

cc: @UlisesGascon @bjohansebas

Activity

  1. MikeMcC399 commented on Oct 5, 2026

    @MikeMcC399
    ContributorAuthor

    Suggestion

    https://github.com/expressjs/compression is an active repo. Consider upgrading to minimum mocha@11 and cutting a new release.

    If that is not possible, then citgm should skip Node.js 26 for compression.

  2. MikeMcC399 commented on Oct 8, 2026

    @MikeMcC399
    ContributorAuthor

    expressjs/compression#295 has been initiated to resolve this issue

  3. MikeMcC399 commented on Oct 27, 2026

    @MikeMcC399
    ContributorAuthor

    @UlisesGascon

    PR expressjs/compression#295 seems to have stalled. Maybe the compression team could give it a helping hand across the line?

    compression CI https://github.com/expressjs/compression/actions/workflows/ci.yml can be expected to transition to a hard failure tomorrow on 2026-10-28 assuming that Node.js 26.13.0 is released as planned with Active LTS status following on from Node.js 24 which has moved into maintenance LTS status.

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