Skip to content

util.isDate is not a function in v23.11.1 (works in LTS v22.x) #59263

@PedroWC

Description

@PedroWC

Version

23.11.1

Platform

10|backend | 2025-07-28T09:30:27: TypeError: util.isDate is not a function
10|backend |     at async exports.emitirRomaneio (/home/myusr/myproject/controllers/Transporte/cadastroNotas.js:214:13)
10|backend | 2025-07-28T09:30:44: TypeError: util.isDate is not a function
10|backend |     at async exports.emitirRomaneio (/home/myusr/myproject/controllers/Transporte/cadastroNotas.js:214:13)
10|backend | 2025-07-28T09:30:59: TypeError: util.isDate is not a function
10|backend |     at async exports.emitirRomaneio (/home/myusr/myproject/controllers/Transporte/cadastroNotas.js:214:13)
10|backend | 2025-07-28T14:41:58: Erro: TypeError: util.isDate is not a function
10|backend |     at async exports.add (/home/myusr/myproject/controllers/usoConsumo/consumiveis.js:791:24)
10|backend | 2025-07-28T15:06:39: Erro: TypeError: util.isDate is not a function
10|backend |     at async exports.add (/home/myusr/myproject/controllers/usoConsumo/consumiveis.js:791:24)
10|backend | 2025-07-28T15:11:22: Erro: TypeError: util.isDate is not a function
10|backend |     at async exports.add (/home/myusr/myproject/controllers/usoConsumo/consumiveis.js:791:24)
10|backend | 2025-07-28T15:57:59: TypeError: util.isDate is not a function
10|backend |     at async exports.emitirRomaneio (/home/myusr/myproject/controllers/Transporte/cadastroNotas.js:214:13)
10|backend | 2025-07-28T15:59:47: TypeError: util.isDate is not a function
10|backend |     at async exports.emitirRomaneio (/home/myusr/myproject/controllers/Transporte/cadastroNotas.js:214:13)

Subsystem

No response

What steps will reproduce the bug?

Use libraries that use util.isDate

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

  • Frequency: 100% on every execution of any script that calls util.isDate().

  • Required condition: Node.js version must be v23.x (tested on v23.11.1). The bug does not occur on v22.x LTS.

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

-> Expected:

  • util.isDate should be a function aliasing util.types.isDate.

  • Calling util.isDate(new Date()) should return true.

-> Rationale:

  • In all previous Node.js releases (including v22.x LTS), util.isDate() existed as a convenience alias for util.types.isDate().

  • The documentation and historical behavior guarantee that util.isDate() remains available for backward compatibility.

What do you see instead?

TypeError: util.isDate is not a function
    at Object.<anonymous> (test-util-isDate.js:3:31)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    …
  • typeof util.isDate prints undefined.

  • util.types.isDate(new Date()) still works as expected.

Additional information

  • OS: Ubuntu 24.04.2 LTS

  • Node.js: v23.11.1

  • npm: 10.9.2

  • Codebase: private repository; no direct references to util.isDate in application source.

  • A global search across our code (including controllers and utility modules) found no occurrences of util.isDate, so the failure likely originates in an external dependency.

  • In v22.x LTS, the same test logs:

util.isDate: true
util.isDate(new Date()): true

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