Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Batch rendering rejects JSON files saved with a byte order mark

未关闭 适合新手
#6,604 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@AksharP5 已经在做这个了。

开始于 2026年10月28日。

  • #6605 来自 @AksharP5 —— 未关闭

评估

难度
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 内容生成。

描述

bug triage/ready
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,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

heygen-com/hyperframes 的其他 Issue

查看 heygen-com/hyperframes 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。