Batch rendering rejects JSON files saved with a byte order mark
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 74/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- cli
调研方向
从 packages/cli/src/jsonFlag.ts 开始,现有 BOM/UTF-16 解码器就在这里;找到 render --batch 使用的批处理读取器——issue 说它绕过了该解码器。让批处理文件的读取经过同一个解码器,并添加一个覆盖带 BOM 的 UTF-8 和 UTF-16LE 输入的测试。完成意味着两个复现命令都渲染一个包含 Café 且带有 total: 1, completed: 1, failed: 0 的视频。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
render --batch rejects otherwise valid batch data saved as UTF-8 with a byte order mark (BOM), or as BOM-marked UTF-16LE. This blocks batch files written by Windows editors and Windows PowerShell 5.1. The CLI already has a decoder for these encodings in jsonFlag.ts, but the batch reader bypasses it.
Minimal reproduction
From a repository checkout after the normal bun install and bun run build, create a one-second project and the two batch files:
node --input-type=module <<'JS'
import { mkdirSync, writeFileSync, copyFileSync } from 'node:fs';
mkdirSync('bom-batch');
writeFileSync('bom-batch/index.html', `<!doctype html>
<html lang="en" data-composition-variables='[{"id":"title","type":"string","label":"Title","default":"Default"}]'>
<head><meta charset="UTF-8"><title>Batch encoding reproduction</title>
<script src="gsap.min.js"></script>
<style>body{margin:0;background:#111;color:#fff;font-family:sans-serif}#root{width:100%;height:100%;display:grid;place-items:center}h1{font-size:36px}</style></head>
<body><div id="root" data-composition-id="main" data-width="320" data-height="180" data-duration="1">
<h1 class="clip" data-start="0" data-duration="1" data-track-index="0"><span data-var-text="title">Default</span></h1>
</div><script>window.__timelines["main"]=gsap.timeline({paused:true});</script></body></html>
`);
copyFileSync('packages/player/node_modules/gsap/dist/gsap.min.js', 'bom-batch/gsap.min.js');
for (const encoding of ['utf8', 'utf16le']) {
writeFileSync(`bom-batch/rows-${encoding}.json`, Buffer.from('\uFEFF[{"title":"Café"}]', encoding));
}
JS
Steps to reproduce
cd bom-batch
node --import ../node_modules/tsx/dist/loader.mjs ../packages/cli/src/cli.ts render \
--batch rows-utf8.json --output 'renders/{index}.mp4' \
--fps 1 --workers 1 --json --quiet --strict-variables
Repeat with --batch rows-utf16le.json. The same problem occurs through the built packages/cli/bin/hyperframes.mjs entry point.
Expected behavior
Decode the file's encoding marker, parse the row and render one video containing Café, as with the same JSON in unmarked UTF-8.
Actual behavior
Both commands exit 1 before rendering with Invalid JSON in --batch. UTF-8 reports Unexpected token at U+FEFF; UTF-16LE reports Unexpected token at U+FFFD after the bytes are decoded as UTF-8. No batch output is produced.
Environment
- Baseline:
7e92aec502c6a56488807c3cf9edb8371c854abd(CLI 0.8.209). - Linux arm64, Node 24.22.1, Bun 1.4.4, FFmpeg/FFprobe 7.0.2, system Chromium 156.0.8078.47.
- Byte-exact UTF-8 BOM and UTF-16LE BOM fixtures were generated on Linux. Native Windows shell execution was not tested.
Additional context
The matching unmarked UTF-8 control renders successfully. Reusing the existing decoder makes both marked inputs render successfully too: each result reports total: 1, completed: 1, failed: 0, durationMs: 1000, with title: "Café". FFprobe confirms H.264, 320×180 and a 1-second duration; decoded frames were inspected.
Related work checked: #5725 covers project configuration, #6580 covers HTML decoding, and #6591 covers undefined injected readers for --variables-file. None changes this batch-file reader.
- 主要语言
- TypeScript
- 星标
- 54.1k
- 派生
- 4.9k
- 平均合并
- 11 小时 3 分钟
- 30 天内合并 PR
- 772
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
heygen-com/hyperframes 的其他 Issue
-
bug difficulty/easy triage/ready
难度 2/5 1-3 小时 新手友好度 78/100
heygen-com/hyperframes#6481 · 2 条评论 ·
维护者通常 1 天内回复
-
Timeline: show a clip's full name when its label is cut off可能已有人在做 @DanielMcSheehy 于 12 天前认领。 未关闭desktop-candidate difficulty/easy enhancement good first issue help wanted triage/ready
难度 2/5 1-3 小时 新手友好度 85/100
heygen-com/hyperframes#5582 · 2 条评论 ·
维护者通常 1 天内回复
-
Studio: press ? to open the keyboard shortcuts panel可能已有人在做 @B-Payal 于 16 天前认领。 未关闭desktop-candidate difficulty/easy enhancement good first issue help wanted triage/ready
难度 2/5 1-3 小时 新手友好度 82/100
heygen-com/hyperframes#5580 · 1 条评论 ·
维护者通常 1 天内回复
-
lint: add tests for three caption rules that have none可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭difficulty/easy enhancement help wanted triage/ready
难度 2/5 1-3 小时 新手友好度 85/100
heygen-com/hyperframes#5388 · 1 条评论 ·
维护者通常 1 天内回复
-
Project archives silently replace existing assets when external paths collide可能已有人在做 @AksharP5 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
heygen-com/hyperframes#6721 ·
维护者通常 1 天内回复
查看 heygen-com/hyperframes 的全部 Issue
相似的 Issue
-
area:desktop area:ui bug platform:macos
难度 2/5 1-3 小时 新手友好度 67/100
anthropics/claude-code#106183 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
feature:App-Tour feature:Chat ready Web
难度 2/5 1-3 小时 新手友好度 62/100
digitalfabrik/integreat-app#4523 · 2 个 reaction ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Required Lexical field accepts two empty paragraphs可能已有人在做 @lazerg 今天认领。 未关闭Bug
难度 2/5 1-3 小时 新手友好度 76/100
payloadcms/payload#19222 ·
维护者通常 1 天内回复