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

Aperta Adatta ai principianti
#276 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
node.js, typescript
Ambito
backend, cli

Direzione di ricerca

Inizia da src/lib/utils/files.ts, in particolare da copyFiles alle righe 9–10, e segui come viene usata da nf build, nf dev e nf build --watch. Aggiungi un test unitario per copiare una cartella di assets con una sottocartella annidata, quindi verifica che venga copiata l’intera struttura senza EISDIR.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
TypeScript
Stelle
2
Fork
2
Merge medio
2g 18h
PR unite (30g)
17

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NanoForge-dev/CLI

Tutte le issue di NanoForge-dev/CLI

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.