*Territory · 3 understandings*
## Summary
Hono's Bun adapter references the Bun global in CJS mode, so Node.js loading the CJS bundle via require() crashes with "ReferenceError: Bun is not defined", and dropping the "require" entries forces Node onto the ESM build, which doesn't trigger the Bun path.
## Explanation
- Hono's Bun adapter eagerly references the Bun global in CJS mode.
- Hono's Bun adapter eagerly references the Bun global in CJS mode.
- When Node.js loads the CJS bundle via require(), it crashes with "ReferenceError: Bun is not defined".
- When Node.js loads the CJS bundle via require(), it crashes with "ReferenceError: Bun is not defined".
- Dropping the "require" entries forces Node to use the ESM build, which doesn't trigger the Bun path.
- Dropping the "require" entries forces Node to use the ESM build, which doesn't trigger the Bun path.
## Threads
- The Bun adapter reaching for the Bun global in CJS mode
- Hono's Bun adapter eagerly references the Bun global in CJS mode.
- Node's require() of the CJS bundle crashing with "ReferenceError: Bun is not defined"
- When Node.js loads the CJS bundle via require(), it crashes with "ReferenceError: Bun is not defined".
- Dropping the "require" entries to route Node to the ESM build
- Dropping the "require" entries forces Node to use the ESM build, which doesn't trigger the Bun path.
## What's still open
Whether the "require" entries were dropped and the package's exports changed is not said.
- Dropping the "require" entries forces Node to use the ESM build, which doesn't trigger the Bun path.
## Consultant
**Where it shows up** — The crash keeps coming up at the point where Node's require() meets the CJS bundle and hits the Bun global; the workaround sits in the "require" entries that route Node to the ESM build.
**A question to sit with** — What would let the CJS bundle stay loadable under Node without reaching for the Bun global at all?
**A way forward** — Keep the ESM route as the working fix, and note in the package's exports which build Node should pick so the "require" entries don't quietly come back.
## Understandings
- Hono's Bun adapter eagerly references the Bun global in CJS mode. — from [[Bevia/World/Sources/NeuroverseOS-Neuroverseos-governance #73 Remove CJS require entries from new exp|NeuroverseOS/Neuroverseos-governance #73 Remove CJS require entries from new exp]] — 2026-03-27
- When Node.js loads the CJS bundle via require(), it crashes with "ReferenceError: Bun is not defined". — from [[Bevia/World/Sources/NeuroverseOS-Neuroverseos-governance #73 Remove CJS require entries from new exp|NeuroverseOS/Neuroverseos-governance #73 Remove CJS require entries from new exp]] — 2026-03-27
- Dropping the "require" entries forces Node to use the ESM build, which doesn't trigger the Bun path. — from [[Bevia/World/Sources/NeuroverseOS-Neuroverseos-governance #73 Remove CJS require entries from new exp|NeuroverseOS/Neuroverseos-governance #73 Remove CJS require entries from new exp]] — 2026-03-27
## Who, where and what
Things: [[Bevia/World/Things/Bun|Bun]], [[Bevia/World/Things/ESM (a28bcb1d)|ESM]], [[Bevia/World/Things/Hono|Hono]], [[Bevia/World/Things/Node (c3c3d083)|Node]], [[Bevia/World/Things/Node.js|Node.js]], [[Bevia/World/Things/ReferenceError- Bun is not defined|ReferenceError: Bun is not defined]], [[Bevia/World/Things/require|require]], [[Bevia/World/Things/require()|require()]]