Next.js 16 with Turbopack has compatibility issues with pino logger when running with Bun runtime:
- Error:
Failed to load external module pino-*: BuildMessage: EISDIR reading "/app/.next/node_modules/pino-*" - Root Cause: Turbopack's dynamic module analysis cannot handle pino's worker thread dynamic requires
- Upstream Issue: Next.js #86099 (still open)
- Affects: Turbopack + Bun/Vercel deployments specifically
Status: ✅ Implemented (Jan 2026)
We've switched to Webpack bundler to avoid Turbopack issues:
// package.json
{
"scripts": {
"dev": "next dev --webpack",
"build": "next build --webpack"
}
}- package.json: Added
--webpackflag to dev and build scripts - tailwind.config.ts: Converted from
require()to ESMimportfor webpack compatibility
- ✅ Pros: Pino works perfectly, production deployments stable
⚠️ Cons: Slightly slower build times compared to Turbopack (acceptable trade-off)
Status: 🔄 Planned
- Monitor Next.js #86099
- Revert to Turbopack once fixed
- ETA: Unknown (issue open since Nov 2025)
- Why: Used by Vercel internally, zero Turbopack issues
- When: Next sprint/maintenance window
- Effort: 2-3 hours
- Benefits: Future-proof for when Turbopack becomes mandatory
Both development and production builds verified working:
# Development
bun run dev
# ✅ Starts on http://localhost:3000
# Production Build
bun run build
# ✅ Compiles successfully
# Production Server
bun run start
# ✅ Starts without pino errors- Next.js Issue #86099 - Turbopack + Pino worker thread issues
- Next.js Issue #86866 - Turbopack + Bun external module loading
- Pino Bundling Docs - Official pino bundling limitations
package.json- Build script configurationtailwind.config.ts- ESM import fixlib/logger.ts- Pino logger configurationinstrumentation.ts- Calibre watcher initialization
Last Updated: January 5, 2026
Next Review: After Next.js 16.2 release or Phase 2 implementation