Skip to content

keyframes --runtime css/anime --json prefixes stdout with text #6226

Closed

Description

@AksharP5

Describe the bug

hyperframes keyframes --runtime css --json and --runtime anime --json exit 0 but write a human-readable notice before the JSON object. A script parsing stdout as JSON fails before it can read the keyframes. The command advertises --json as machine-readable output for agents.

Minimal reproduction

From a built checkout of heygen-com/hyperframes at 24965372dbbec90391978e223616c75045b9a813:

cat > keyframes-repro.html <<'HTML'
<!doctype html>
<html>
<head>
<style>
@keyframes rise { from { opacity: 0; } to { opacity: 1; } }
.dot { animation: rise 1s; }
</style>
</head>
<body>
<div data-composition-id="main" data-duration="1" data-width="1920" data-height="1080">
<div class="dot"></div>
</div>
<script>
anime({ targets: '.dot', opacity: [0, 1], duration: 1000 });
</script>
</body>
</html>
HTML
HYPERFRAMES_NO_UPDATE_CHECK=1 DO_NOT_TRACK=1 node packages/cli/bin/hyperframes.mjs \
  keyframes keyframes-repro.html --runtime css --json > keyframes.json
node -e 'JSON.parse(require("node:fs").readFileSync("keyframes.json", "utf8"))'

Steps to reproduce

  1. Build the checkout with bun install --frozen-lockfile and bun run build.
  2. Run the self-contained example above. No media, browser session, or Anime.js download is needed because this command inspects source statically.
  3. Repeat with --runtime anime.

Expected behavior

The complete stdout is one JSON object. JSON.parse succeeds for either runtime filter.

Actual behavior

CSS stdout starts with:

keyframes: css output is a static authoring surface; use validate/render/snapshot to verify runtime adapter seekability.

{

The CLI exits 0, but the parser fails with:

SyntaxError: Unexpected token 'k', "keyframes:"... is not valid JSON

Anime.js produces the same failure, with anime in the notice. Default --runtime all does not take this notice path.

Environment

  • HyperFrames 0.8.192, baseline 24965372dbbec90391978e223616c75045b9a813.
  • Linux x86_64, Node.js v26.11.1, Bun 1.4.1.
  • The repository requests Bun 1.4.4. No upgrade was performed; the build and focused tests completed with 1.4.1. The failure is reproduced by the built CLI running under supported Node.js.
  • doctor --json confirms Node.js, FFmpeg n9.0.2, FFprobe n9.0.2, and cached Chrome 152.0.7977.30. Optional Kokoro/MusicGen are absent and Docker is stopped; none is used by this static inspection command.

Additional context

The notice in packages/cli/src/commands/keyframes.ts is printed before the args.json branch without checking JSON mode.

Before implementation and again at 2026-10-24 16:31 UTC, searched public open and closed issues and PRs for keyframes json, keyframes stdout, keyframes "static authoring", and keyframes runtime json. Read #5959, #5526, #2374, and #5534. They concern render transforms, unresolved timing, template extraction, and a release; none reports or claims this stdout failure. No matching public report or active implementation was found in those searches.

Upstream advanced to 3d45d1b037860afd42439a2b4ca7e0dc762448c3 during verification. Its only change is an engine audio-encoding fix, and the CLI source involved here is unchanged.

Activity

  1. miguel-heygen commented on Oct 24, 2026

    @miguel-heygen
    Collaborator

    Thanks, reproduced on 0.8.193 with your example. keyframes --runtime css --json and --runtime anime --json both exit 0 but put the "static authoring surface" notice on stdout before the JSON, so JSON.parse fails. --runtime all --json parses fine. The notice in packages/cli/src/commands/keyframes.ts is printed before the --json branch without checking for JSON mode. Your PR #6228 covers it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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