Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#4,365 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
backend, build-system, cli

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
54.1k
Fork
4.9k
Merge trung bình
7 giờ 29 phút
Pull request đã merge (30 ngày)
778

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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của heygen-com/hyperframes

Tất cả issue của heygen-com/hyperframes

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.