Version
22.13.0
Platform
Ubuntu 22.04.5 LTS (x86_64)
Subsystem
No response
What steps will reproduce the bug?
A Jest custom reporter is referenced directly as a .ts file:
reporters: [
'<repo-root>/tests/src/reporters/log-on-failure.reporter.ts',
'default',
]
### How often does it reproduce? Is there a required condition?
Always on the affected environment.
Required conditions:
- Node.js v22.13.0
- Ubuntu 22.04.5 LTS (x86_64)
- A Jest custom reporter referenced directly as a `.ts` file
- The reporter contains TypeScript syntax such as type annotations (`: string`)
- The reporter is loaded through Jest/Node without an explicit TypeScript loader
Observed behavior:
- Reproduces consistently on every run on Node.js v22.13.0
- Does not reproduce on a separate macOS Apple Silicon machine running Node.js v22.22.x using the same repository, branch, and reporter source
Example command:
```bash
pnpm run test:infra
### What is the expected behavior? Why is that the expected behavior?
When this scenario is not supported on the current Node.js version, Node.js should provide a more actionable error message that helps developers identify the root cause and potential resolution.
Instead of only reporting:
```text
SyntaxError: Unexpected token ':'
### What do you see instead?
```text
SyntaxError: Unexpected token ':'
### Additional information
_No response_
Version
22.13.0
Platform
Subsystem
No response
What steps will reproduce the bug?
A Jest custom reporter is referenced directly as a
.tsfile: