Generated backend's own 'test' script fails on Bun 1.4.4: vitest 5.1.1 'child.channel?.unref is not a function', 0 tests run
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 61/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- bun, typescript
Direzione di ricerca
Start by locating the generated backend package.json and the scaffold tests that generate a Bun backend. Reproduce with Bun 1.4.4 using the reported scaffold commands, then check which generated test script fails under Vitest. Done means a fresh scaffold's bun run test exits successfully with one passing test, with the behavior covered by a scaffold test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
The test that flisk resource <name> --type backend writes passes under Bun's runner but the project's own test script (vitest run) fails before any test starts when run through Bun.
Repro (flisk 1.4.73, Bun 1.4.4, macOS)
mkdir demo && cd demo && flisk project --yes
flisk resource api --type backend --framework hono --path api --local --stack app --yes
cd api && bun install
bun test # 1 pass, 0 fail, 2 expect() calls (Bun's own runner)
bun run test # runs "vitest run"
Output of bun run test:
Error: [vitest-pool]: Failed to start forks worker for test files .../tests/api.test.ts.
Caused by: TypeError: child.channel?.unref is not a function.
Test Files no tests
Tests no tests
Errors 1 error
error: script "test" exited with code 1
Same with bunx vitest run.
Numbers
| Runner | Tests found | Tests run | Result |
|---|---|---|---|
bun test |
1 | 1 | pass |
bun run test (vitest run, pinned vitest 5.1.1) |
1 | 0 | exit 1 |
Scripts in generated package.json that need vitest |
2 (test, test:watch) of 8 |
||
| Time to failure | about 5 ms |
Before
The first command a new user runs after scaffolding a Bun backend (test) fails with an error inside a dependency, and the project looks broken. flisk doctor does not run or mention the test script.
After
- Generated Bun backends use
"test": "bun test"(and"test:watch": "bun test --watch"), or the vitest pool is pinned tothreadsfor Bun, or the vitest pin is bumped to a version that works on Bun. - Add a scaffold test: generate a Bun backend and run its
testscript in CI with the same Bun version as the docs.
Acceptance
In a fresh scaffold, bun run test exits 0 with 1 passed.
Note: Bun on this machine also provides node as a shim (node --version prints "Missing script to execute"), which may be why vitest's forks pool breaks; the fix should not depend on a real Node.
Found by the /dogfood loop. Related: #108.
- Lingua principale
- TypeScript
- Stelle
- 1
- Fork
- 2
- Merge medio
- 11h 39m
- PR unite (30g)
- 92
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di flisk-sh/flisk-cli
-
area: infrastructure community docs docs-mismatch documentation dogfood dx good first issue has-repro priority:low small-fix
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
area: cli dogfood dx enhancement error-messages good first issue has-repro misleading-message priority:low small-fix tdd tech: typescript
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
flisk-sh/flisk-cli#196 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area: cli discoverability docs-mismatch dogfood dx enhancement good first issue has-repro priority:low small-fix tdd tech: typescript
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
flisk-sh/flisk-cli#195 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area: cli bug discoverability docs-mismatch documentation dogfood error-messages has-repro misleading-message priority:medium small-fix
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
area: cli bug dx good first issue has-repro needs-test priority:medium small-fix
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
flisk-sh/flisk-cli#176 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di flisk-sh/flisk-cli
Issue simili
-
accessibility area:ci ci-test level:low priority:high type:test
Difficoltà 2/5 1-3 ore Idoneità per principianti 71/100
skytuhua-org/Gen-V1#3132 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
drmrd/vernacular#1238 ·
I maintainer di solito rispondono entro 1 giorno
-
question
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
enhancement migration-prioritized
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
Hudson-Pufferfish/local-party-console#136 ·
I maintainer di solito rispondono entro 1 giorno
-
priority:medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno