Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

render: --variables-file (and --variables <path>) fails with "io.readFile is not a function" since 0.8.212

已關閉 適合新手
#6,830 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@miguel-heygen 已經在處理了。

開始於 2026年10月30日。

  • #6831 來自 @miguel-heygen —— 未關閉

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
76/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
node.js, typescript
領域
cli

研究方向

追蹤 render --variables-file、--variables <path> 和 --variables -,直到 resolveVariablesArg 和 parseVariablesArg;Issue 指出未定義的 I/O 回呼如何覆蓋 readJsonFlagText 中的預設值。閱讀相關的 CLI 實作及其測試,然後針對檔案和 stdin 輸入執行專項測試。當這些輸入能成功解析,且 inline JSON 和 --batch 的行為仍正常運作時,工作即告完成。

由索引模型根據 Issue 內容生成。

描述

bug triage/needs-triage
Describe the bug

hyperframes render --variables-file <file> fails before rendering on every version from 0.8.212 to 0.8.221 (latest at the time of writing). The same failure hits --variables <path> and --variables - (stdin). Inline JSON (--variables '{"title":"x"}') and --batch <file> still work.

Minimal reproduction

Any project with data-composition-variables:

echo '{}' > /tmp/vars.json
npx -y [email protected] render . --variables-file /tmp/vars.json -o /tmp/out.mp4
✗  Could not read the variables JSON
   /tmp/vars.json: io.readFile is not a function
Version --variables-file
0.8.210, 0.8.211 reads the file, render proceeds
0.8.212, 0.8.213, 0.8.216, 0.8.221 io.readFile is not a function

Linux (WSL2 Ubuntu), Node 24.19.0.

Cause (from the published dist of 0.8.221)

resolveVariablesArg(inline, filePath) calls parseVariablesArg(inline, filePath) with no readFile / readStdin, so it passes { readFile: undefined, readStdin: undefined } to readJsonFlagText:

function readJsonFlagText(value, partialIo = {}) {
  const io = { ...defaultIO, ...partialIo };   // undefined overrides the defaults
  ...
  return trimmed === "-" ? io.readStdin() : io.readFile(value);

An object spread copies keys whose value is undefined, so io.readFile is undefined.

Steps to reproduce
echo '{}' > /tmp/vars.json
npx -y [email protected] render . --variables-file /tmp/vars.json -o /tmp/out.mp4
Expected behavior

A rendered mp4 using the variables file is created

Actual behavior

◆ Rendering variables-fixture → C:\node_projects\hftemptest\out.mp4
30fps · standard · auto workers (16 cores detected)
GPU: browser GPU (auto-detect)

✗ Could not read the variables JSON

vars.json: io.readFile is not a function

Environment
The failed checks (unzip, FFmpeg, optional tools) are unrelated: the error is thrown while the flag is parsed, before any browser or encoder is touched.


hyperframes doctor
  ✓ Version          0.8.221 (latest)
  ✓ Node.js          v24.19.0 (linux x64)
  ✓ CPU              16 cores · Intel(R) Core(TM) Ultra 7 265H
  ✓ Memory           15.6 GB total · 6.0 GB available
  ✓ Disk             925.5 GB free
  ✓ Frames cache     /tmp/hyperframes-extract-cache-1000 · 925.5 GB free at /tmp · default
  ✗ Archive extractor Not found
  ✓ Settings lock    Not locked
  ✓ /dev/shm         7995 MB
  ✓ Environment      WSL · non-TTY
  ✗ whisper-cpp      Not found (optional — needed for transcription)
  ✗ TTS (Kokoro)     Not installed (optional — local voice fallback)
  ✗ BGM (MusicGen)   Not installed (optional — local music fallback)
  ✓ onnxruntime-node Not installed (installs on first use)
  ✓ @google/genai    Not installed (installs on first use)
  ✗ FFmpeg           FFmpeg is required to encode video.
  ✗ FFprobe          FFprobe is required to probe media assets.
  ✓ Chrome           cache: ~/.cache/hyperframes/chrome/chrome-headless-shell/linux-152.0.7977.30/...
  ✓ Docker           Docker version 29.6.2, build dfc4efb
  ✗ Docker running   Not running
Additional context

No response

主要語言
TypeScript
星號
54.1k
分支
4.9k
平均合併
8 小時 26 分鐘
30 天內合併 PR
790

環境準備

這個專案沒有提供開發容器、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 摘要。