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

hyperframes_version mp4 tag is always 0.0.0-dev: readEngineVersion() resolves ../../package.json and overshoots the package root

已关闭
#4,365 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
typescript

调研方向

Start with packages/engine/src/utils/renderProvenance.ts and compare its source, standalone-engine, and bundled CLI layouts, including dist/cli.js and dist/fontLocalizeCli.js. Reconcile the report with open PR #3695 before changing anything, then verify the foreign-package fallback and actual MP4 version tagging using the reproduction and ffprobe command. Done means current-head behavior is correct across the packaging matrix.

由索引模型根据 Issue 内容生成。

描述

difficulty/medium triage/needs-triage

Summary

readEngineVersion() resolves ../../package.json, which overshoots the package root in the published layout. The lookup throws MODULE_NOT_FOUND, a bare catch swallows it, and every rendered mp4 is stamped hyperframes_version = 0.0.0-dev instead of the real version.

hyperframes_renderer is stamped correctly, so the tag block looks healthy at a glance.

Affected

[email protected] (current). Present in both dist/cli.js and dist/fontLocalizeCli.js.

The code

dist/cli.js:74652

function readEngineVersion() {
  try {
    const version2 = createRequire(import.meta.url)("../../package.json").version;
    return typeof version2 === "string" && version2.length > 0 ? version2 : UNKNOWN_VERSION;
  } catch {
    return UNKNOWN_VERSION;   // UNKNOWN_VERSION = "0.0.0-dev"
  }
}

Reproduce

mkdir /tmp/hf && cd /tmp/hf && npm pack [email protected] && tar xzf hyperframes-0.8.68.tgz
node -e '
const p = require("path");
const cli = p.resolve("package/dist/cli.js");
for (const rel of ["../../package.json", "../package.json"]) {
  const r = p.normalize(p.join(p.dirname(cli), rel));
  console.log(rel, "->", r, require("fs").existsSync(r) ? "EXISTS" : "MISSING");
}'

Output:

../../package.json -> /tmp/hf/package.json          MISSING
../package.json    -> /tmp/hf/package/package.json  EXISTS

End to end: render any composition to mp4 and read the tags back.

ffprobe -v error -show_entries format_tags -of default=noprint_wrappers=1 out.mp4 | grep hyperframes

Expected hyperframes_version=0.8.68, actual hyperframes_version=0.0.0-dev.

Suggested fix

../../package.json → ../package.json at both sites.

Separately worth considering: the bare catch is why this went unnoticed. A MODULE_NOT_FOUND here means the build layout moved, which is not the same as "version unavailable" — logging it, or distinguishing it from a genuinely absent version, would surface the next occurrence rather than silently degrading to a sentinel that reads like real data.

Why it matters

The tag is the only in-band record of which engine produced a file. When it is a constant, a rendered mp4 carries no evidence of its own provenance, and a pinned version cannot be verified after the fact from the artifact — only from whatever external notes happened to be kept.

Triage follow-up — September 23, 2026

Existing implementation: #3695 (fix(engine): resolve provenance version from the owning package), which predates this report. It is open and awaiting review; please reconcile this report with that PR before starting another implementation.

Current main fa4261bee still contains the depth-specific lookup in packages/engine/src/utils/renderProvenance.ts. The reporter's correction is important: changing ../../ to ../ fixes the flat bundle but breaks the source layout.

Review scope: source, standalone engine, bundled CLI, foreign-package fallback, and actual output-version tagging. The proposed PR's tests were not rerun in this triage pass. difficulty/medium reflects the packaging/test matrix; the issue stays in triage until current-head verification and scope reconciliation are complete.

主要语言
TypeScript
星标
54.1k
派生
4.9k
平均合并
1 天 16 小时
30 天内合并 PR
725

环境准备

这个项目没有提供开发容器、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 摘要。