Skip to content

clinic doctor does not generate report with Node.js >= 21.7.0 #480

@rhyek

Description

@rhyek

It seems to be an issue OS signal handling in this line. I modified clinic doctor's source code to print relevant logs.

node = 21.7.0

❯ rm -f node_trace.1.log && rm -rf .clinic && npx clinic doctor -- node ./dist/core-svc/src/main.js
To generate the report press: Ctrl + C
[Nest] 16985  - 06/11/2025, 9:30:58 AM     LOG [NestFactory] Starting Nest application...
[Nest] 16985  - 06/11/2025, 9:30:58 AM     LOG [InstanceLoader] AppModule dependencies initialized +1ms
[Nest] 16985  - 06/11/2025, 9:30:58 AM     LOG [InstanceLoader] TestEndpointsModule dependencies initialized +0ms
[Nest] 16985  - 06/11/2025, 9:30:58 AM     LOG [InstanceLoader] GraphQLSchemaBuilderModule dependencies initialized +0ms
[Nest] 16985  - 06/11/2025, 9:30:58 AM     LOG [InstanceLoader] GraphQLModule dependencies initialized +0ms
Enabling inline tracing for this subgraph. To disable, use ApolloServerPluginInlineTraceDisabled.
[Nest] 16985  - 06/11/2025, 9:30:58 AM     LOG [GraphQLModule] Mapped {/graphql, POST} route +186ms
[Nest] 16985  - 06/11/2025, 9:30:58 AM     LOG [NestApplication] Nest application successfully started +1ms
Listening on port 4002
^C[    ] Received Ctrl+C, closing process...
process.once SIGINT

node = 21.6.2 (last 21.6 patch release)

❯ rm -f node_trace.1.log && rm -rf .clinic && npx clinic doctor -- node ./dist/core-svc/src/main.js
To generate the report press: Ctrl + C
[Nest] 17342  - 06/11/2025, 9:34:00 AM     LOG [NestFactory] Starting Nest application...
[Nest] 17342  - 06/11/2025, 9:34:00 AM     LOG [InstanceLoader] AppModule dependencies initialized +1ms
[Nest] 17342  - 06/11/2025, 9:34:00 AM     LOG [InstanceLoader] TestEndpointsModule dependencies initialized +0ms
[Nest] 17342  - 06/11/2025, 9:34:00 AM     LOG [InstanceLoader] GraphQLSchemaBuilderModule dependencies initialized +0ms
[Nest] 17342  - 06/11/2025, 9:34:00 AM     LOG [InstanceLoader] GraphQLModule dependencies initialized +0ms
Enabling inline tracing for this subgraph. To disable, use ApolloServerPluginInlineTraceDisabled.
[Nest] 17342  - 06/11/2025, 9:34:01 AM     LOG [GraphQLModule] Mapped {/graphql, POST} route +187ms
[Nest] 17342  - 06/11/2025, 9:34:01 AM     LOG [NestApplication] Nest application successfully started +0ms
Listening on port 4002
^C[    ] Received Ctrl+C, closing process...
process.once SIGINT

proc.once exit
Analysing data
Generated HTML file is file:///Users/carlos/Dev/truelogic/tyb/tyb-dev/projects/core-svc/.clinic/17342.clinic-doctor.html

process.once beforeExit

If i change that line to use process.on instead of process.once it does work. I don't see any relevant changes in the 21.7.0 changelog.

I had initially been testing with 22.6.0 where it doesn't work either.

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