nf build fails with EISDIR when the assets folder has a subfolder

オープン 初心者向け
#276 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
88/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
node.js, typescript
領域
backend, cli

調査の方向性

src/lib/utils/files.ts、特に9~10行目のcopyFilesから始め、nf build、nf dev、nf build --watchがどのようにこれを使うかをたどってください。ネストしたサブフォルダーを含むassetsフォルダーをコピーするユニットテストを追加し、EISDIRを発生させずにディレクトリー全体がコピーされることを確認してください。

索引モデルが issue の本文から書いたものです。

説明

bug command:build good first 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):

  1. A client project with assets/a.png and assets/sprites/b.png.
  2. nf build
  3. Error: EISDIR: illegal operation on a directory, copyfile '.../assets/sprites' -> '.../dist/sprites', Build failed!, exit code 1. dist/ holds only a.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時間
マージ済み PR(30日)
17

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NanoForge-dev/CLI のほかの issue

NanoForge-dev/CLI の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。