nf build fails with EISDIR when the assets folder has a subfolder
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 88/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- node.js, typescript
调研方向
从 src/lib/utils/files.ts 开始,重点查看第 9–10 行的 copyFiles,并追踪 nf build、nf dev 和 nf build --watch 如何使用它。添加一个单元测试,用于复制包含嵌套子文件夹的 assets 文件夹,然后验证整个目录树都能复制完成且不会出现 EISDIR。
由索引模型根据 Issue 内容生成。
描述
Which package is this bug report for?
@nanoforge-dev/cli
Which command is this bug report for?
build
Issue description
nf build fails with EISDIR as soon as the assets folder has a subfolder. copyFiles lists readdirSync(from, { recursive: true }), which returns folders as well as files, and calls copyFileSync on every entry without creating the subfolders in the output (src/lib/utils/files.ts#L9-L10). nf dev and nf build --watch fail the same way. Related to #12 (the feature that added the asset copy).
Steps to reproduce (reproduced with dist/nf.js):
- A client project with
assets/a.pngandassets/sprites/b.png. nf buildError: EISDIR: illegal operation on a directory, copyfile '.../assets/sprites' -> '.../dist/sprites',Build failed!, exit code 1.dist/holds onlya.png.
Expected: the whole assets tree is copied (e.g. fs.cpSync(from, to, { recursive: true })), with a unit test on a nested assets folder.
Found during a read-only audit of main at e95b881 (2026-11-11).
Code sample
// assets/a.png
// assets/sprites/b.png
// nf build -> EISDIR: illegal operation on a directory, copyfile 'assets/sprites' -> 'dist/sprites'
Versions
- @nanoforge-dev/cli 3.0.1 (main, e95b881)
- Node.js 26.7.0
- Bun 1.3.14 (bundled)
- Linux
Issue priority
High (immediate attention needed)
I have tested this issue on a development release
e95b881
- 主要语言
- TypeScript
- 星标
- 2
- 派生
- 2
- 平均合并
- 2 天 18 小时
- 30 天内合并 PR
- 17
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NanoForge-dev/CLI 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
NanoForge-dev/CLI#294 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
NanoForge-dev/CLI#293 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
NanoForge-dev/CLI#292 ·
维护者通常 1 天内回复
-
command:dev enhancement good first issue refactor
难度 2/5 1-3 小时 新手友好度 78/100
NanoForge-dev/CLI#281 ·
维护者通常 1 天内回复
-
documentation good first issue
难度 1/5 1 小时以内 新手友好度 74/100
NanoForge-dev/CLI#228 ·
维护者通常 1 天内回复
查看 NanoForge-dev/CLI 的全部 Issue
相似的 Issue
-
Mend: dependency security vulnerability
难度 1/5 1-3 小时 新手友好度 65/100
fdm-monster/fdm-monster#5563 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
be-BOP-io-SA/be-BOP#2849 ·
-
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
1️⃣ phase/under-investigation flaky/confirmed flaky/needs-decision type/bug
难度 2/5 1-3 小时 新手友好度 65/100
growilabs/growi#12246 · 3 条评论 ·
维护者通常 1 天内回复
-
🐛 The Rulekeeper - An index run that gives up on the lock ends Succeeded可能已有人在做 @github-actions 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
SSWConsulting/SSW.Rules#2809 · 1 条评论 ·
维护者通常 1 天内回复