Batch rendering rejects JSON files saved with a byte order mark
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 74/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- cli
Hướng nghiên cứu
Bắt đầu trong packages/cli/src/jsonFlag.ts, nơi có bộ giải mã BOM/UTF-16 hiện có, và tìm trình đọc batch mà render --batch dùng — issue nói rằng nó bỏ qua bộ giải mã đó. Cho việc đọc tệp batch đi qua cùng bộ giải mã và thêm một test bao phủ đầu vào UTF-8 và UTF-16LE có BOM. Hoàn thành nghĩa là cả hai lệnh tái hiện đều render một video chứa Café với total: 1, completed: 1, failed: 0.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 54.1k
- Fork
- 4.9k
- Merge trung bình
- 11 giờ 3 phút
- Pull request đã merge (30 ngày)
- 772
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của heygen-com/hyperframes
-
bug difficulty/easy triage/ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
heygen-com/hyperframes#6481 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Timeline: show a clip's full name when its label is cut offCó thể đã có người làm @DanielMcSheehy đã nhận 11 ngày trước. Đang mởdesktop-candidate difficulty/easy enhancement good first issue help wanted triage/ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
heygen-com/hyperframes#5582 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Studio: press ? to open the keyboard shortcuts panelCó thể đã có người làm @B-Payal đã nhận 16 ngày trước. Đang mởdesktop-candidate difficulty/easy enhancement good first issue help wanted triage/ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
heygen-com/hyperframes#5580 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
lint: add tests for three caption rules that have noneCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởdifficulty/easy enhancement help wanted triage/ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
heygen-com/hyperframes#5388 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Project archives silently replace existing assets when external paths collideCó thể đã có người làm @AksharP5 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
heygen-com/hyperframes#6721 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của heygen-com/hyperframes
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
better-auth/better-auth#12132 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
o8 next debug build aborts on Glass to Dark appearance switch (nil identifier messaged before check)Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
hurttlocker/o8#5112 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
webrecorder/wabac.js#386 ·
-
needs-triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 92/100
agent-of-empires/agent-of-empires#5098 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày