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

inspector: build.mjs resolves paths with URL#pathname, fails ENOENT (F:\\F:\\...) and aborts bun run build on Windows

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

维护者通常 1 天内回复

@shuaiyafei 已经在做这个了。

开始于 2026年10月21日。

  • #6010 来自 @shuaiyafei —— 未关闭

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
88/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃

调研方向

阅读 packages/inspector/build.mjs,并将其中的路径 helper 与 issue 中提到的 repository 示例进行比较。在 Windows 上运行 bun run build 复现问题,然后确认 helper 使用 fileURLToPath 后 package build 成功。双重驱动器前缀消失,且 root build 能继续通过 inspector package,即表示完成。

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

描述

Summary

bun run build fails on Windows in the new @hyperframes/inspector package:

@hyperframes/inspector build $ node build.mjs
Error: ENOENT: no such file or directory, open
  'F:\F:\PINOKIO\Run\PINOKIO\api\HyperFrames-Studio.git\app\packages\inspector\package.json'
    errno: -4058, code: 'ENOENT', syscall: 'open'
Exited with code 1
error: script "build" exited with code 1

Note the doubled drive prefix F:\F:\.

Root cause

packages/inspector/build.mjs:8:

const at = (path) => new URL(path, import.meta.url).pathname;

On Windows, URL#pathname for a file:///F:/... URL is /F:/... — a POSIX-style, drive-letter-in-path string. fs.readFileSync("/F:/...") resolves against the current drive (F:), producing F:\F:\..., which does not exist.

Everywhere else in the repo this is done correctly with fileURLToPath() (e.g. packages/producer/scripts/test-classification.mjs, packages/cli/scripts/build-copy.mjs, scripts/rewrite-relative-import-extensions.mjs), which yields F:\... as expected.

at() is used for readFileSync (line 9), all esbuild entryPoints/outfiles (lines 19–44), the tsc -p argument (line 49), copyFileSync (line 51) and rewriteRelativeImportExtensions (line 52) — so the whole script dies on the first read.

Impact

The root build script is an && chain:

... && bun run --filter '@hyperframes/{engine,producer,player,studio,shader-transitions,aws-lambda,gcp-cloud-run,sdk,inspector}' build && bun run --filter '@hyperframes/cli' build && ...

One failing member aborts the chain, so @hyperframes/cli and @hyperframes/sdk-playground never build either — bun run build is simply broken on Windows for any fresh clone.

Repro

Windows + Node:

git clone https://github.com/heygen-com/hyperframes.git
cd hyperframes
bun install
bun run build

(The failure is deterministic — no race, no network involved.)

Suggested fix

import { fileURLToPath } from "node:url";
const at = (path) => fileURLToPath(new URL(path, import.meta.url));

This matches the convention used by the rest of the repo and is a no-op on POSIX.

Environment

  • OS: Windows 10/11, repo at origin/main @ b46ebedea
  • Node v24.18.0, bun via bun run build
  • Discovered while a launcher script (git clone + bun install + bun run build) reproduced it end to end
主要语言
TypeScript
星标
54.1k
派生
4.9k
平均合并
9 小时 46 分钟
30 天内合并 PR
652

环境准备

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