From a43ad6a55f59d91e92596ffc20bbfdc1ec393f85 Mon Sep 17 00:00:00 2001 From: David Susskind Date: Mon, 31 Aug 2026 14:03:40 +0300 Subject: [PATCH] docs(base44-troubleshooter): say that --follow --json is NDJSON A live tail cannot be the "single machine-readable JSON document" the CLI's --json rule promises elsewhere: writeFollowLine emits one object per line as lines arrive (logs.ts:127-130), and on a lost stream the error is appended as one more object by writeJsonError (Base44Command.ts:42-66). A consumer waiting for a closing bracket waits forever. Says so, and shows the error envelope, so an agent parsing --follow --json treats the failure as data rather than as truncated output. --- skills/base44-troubleshooter/references/project-logs.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/skills/base44-troubleshooter/references/project-logs.md b/skills/base44-troubleshooter/references/project-logs.md index 8860eed..73a142b 100644 --- a/skills/base44-troubleshooter/references/project-logs.md +++ b/skills/base44-troubleshooter/references/project-logs.md @@ -79,7 +79,8 @@ npx base44 logs --follow --function my-function - `--env` defaults to `preview`. If `prod` returns no logs, the app may not have been published yet — try `--env preview` to see draft logs. - **`No logs found matching the filters.` is ambiguous.** It means one of: the run has not been ingested yet (~20-30s; wait and re-run — *do not* change flags), there is no function by that name, or a `--function` filter dropped unstamped rows from a legacy per-function deployment. It never means "the app is healthy". - `--follow` streams logs indefinitely (oldest to newest) instead of a single fetch; it's incompatible with `--since`, `--until` and `--order`. A stream that is lost and cannot be re-established ends the command with an error rather than dropping to polling. See [Following logs live](#following-logs-live). -- Pass the global `--json` flag to emit each log entry (or, with `--follow`, each new line) as JSON instead of the human-readable format. +- Pass the global `--json` flag to emit each log entry as JSON instead of the human-readable format. +- **With `--follow`, `--json` output is one JSON object per line, not one JSON document.** Parse it line by line as it arrives; there is no closing bracket, because a live tail never ends normally. If the stream is lost, the error arrives as one more object on its own line — `{"error": "The realtime log stream stopped and could not be re-established", "code": "API_ERROR", "hints": [...]}` — so a consumer that parses per line sees the failure as data rather than as a broken document. ## Following logs live