Skip to content

Assertion crashes when using Node.js 24.1.0 and tsx 4.20.0 #997

@wellwelwel

Description

@wellwelwel

After updating tsx from v4.19.4 to v4.20.0 using Node.js v24.1.0, Poku crashes when using assert method:

> poku@3.0.2 test
> tsx src/bin/index.ts test/unit test/integration test/e2e

node:internal/assert:17
  throw new ERR_INTERNAL_ASSERTION(message);
        ^

Error [ERR_INTERNAL_ASSERTION]: Unexpected module status 3.
This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues

    at assert.fail (node:internal/assert:17:9)
    at ModuleJob.runSync (node:internal/modules/esm/module_job:314:12)
    at require (node:internal/modules/esm/translators:150:9)
    at <anonymous> (**/poku/src/services/reporters/poku.ts:6:24)
    at Object.<anonymous> (***/poku/src/services/reporters/poku.ts:244:4)
    at loadCJSModule (node:internal/modules/esm/translators:165:3)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:207:7)
    at ModuleJob.runSync (node:internal/modules/esm/module_job:306:39)
    at require (node:internal/modules/esm/translators:150:9)
    at <anonymous> (***/poku/src/builders/reporter.ts:2:22) {
  code: 'ERR_INTERNAL_ASSERTION'
}

Node.js v24.1.0

Temporary workarounds

  • A) Downgrade Node.js to v22.x.x.
  • B) Downgrade tsx to v4.19.4.

EDIT: Fixed (reverted) in tsx v4.20.3 🚀

Important

As the error didn't occur without updating tsx (even using Node.js 24), every help trying to provide a minimum viable reproduction using only node:assert and tsx is welcome.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions