Debug mode ingest server returns 204 but no log file is created

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Debug instrumentation appears to run, but the debug log file is never created.

During runtime the API executes normally and the debug server responds, but no NDJSON log file is written to disk.

Observed behavior

The API runs an import task successfully.

The debug server on 127.0.0.1:7242 responds with 204 when tested via curl.

However, the expected log file (debug-*.log) never appears in the workspace.

The debug ingest server accepts requests but does not persist anything to disk.

Example behavior:

curl http://127.0.0.1:7242 → 204

Debug server shows activity

No log file created in workspace root

What seems to be happening

The instrumentation compiles and runs, but the import job finishes before the dev server reloads with the instrumented TypeScript code. As a result:

fetch() calls from the API process cannot reach the ingest server at runtime

The ingest server responds to manual requests but does not write logs

The debug session may not be fully initialized when the requests arrive

Additional observation

The issue only appears when running a long import task immediately after starting the dev server. If the server is restarted and logs are sent later, behavior may differ.

Question

Is the debug ingest server expected to write the log file immediately upon receiving requests, or only after the session is fully initialized?

Also, is there a recommended pattern for Node.js runtimes to guarantee logs are written when using Debug mode?

Steps to Reproduce

  1. Open Cursor and enable Debug mode for the workspace/project

  2. Start the debug session so the Cursor debug ingest server is running (expected at 127.0.0.1:7242)

  3. In a terminal, start the Node API dev server (TypeScript via tsx/ts-node), e.g. pnpm dev

  4. Trigger the import job immediately after startup (the job runs inside the API process and makes debug log/ingest calls)

  5. Verify the API completes the import successfully

  6. From the same terminal, verify the ingest server is reachable:

    • curl -i http://127.0.0.1:7242 returns 204
  7. Check the workspace root for a debug log file (e.g., debug-*.log)

Expected: a debug-*.log file is created and populated after the first successful ingest/log event
Actual: ingest server responds (204) but no log file is created, and nothing is persisted to disk

Expected Behavior

When Debug mode is enabled in Cursor and the application sends instrumentation events to the debug ingest server (127.0.0.1:7242), the server should create a debug log file in the workspace root (for example debug-*.log) and persist incoming events in NDJSON format.

After the first successful ingest request:

the debug log file should be created automatically

subsequent instrumentation events should be appended to that file

the file should appear shortly after the first request, without requiring a restart of the dev server or the debug session

In other words, once the ingest server responds successfully (HTTP 204), the corresponding debug events should be written to disk and visible in the workspace log file.

Screenshots / Screen Recordings

Operating System

Windows 10/11

Version Information

Version: 2.6.11 (user setup)
VSCode Version: 1.105.1
Commit: 8c95649f251a168cc4bb34c89531fae7db4bd990
Date: 2026-03-03T18:57:48.001Z
Build Type: Stable
Release Track: Default
Electron: 39.6.0
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200

For AI issues: which model did you use?

any

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report and the screenshot.

A couple quick questions to narrow this down:

  1. When you enable Debug mode, do you see a toast in Cursor that says NDJSON ingest server started? That confirms the server actually started and is ready to save logs.

  2. Based on what you described, the sync (import starts right when the dev server starts, before tsx or ts-node reloads with the instrumented code) likely means the agent-added fetch() calls aren’t actually running at runtime. Try this: start the dev server, wait for the full reload after the agent instruments the code, then manually start the import.

  3. In Help > Toggle Developer Tools > Network tab, can you check whether requests from your API process are reaching 127.0.0.1:7242?

There’s a known issue with Node.js or TypeScript runtimes that use HMR. The instrumented code needs a full dev server reload before the debug calls start running. If the task runs before the reload finishes, the original non-instrumented code runs, and nothing reaches the ingest server.

About using fs.appendFileSync as a workaround, yes, that’s an alternative pattern the agent can fall back to, but the ingest server should work if the timing is right.

Let me know if it still happens after you confirm the reload completes before you start the import.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.