We hit a blocking issue deploying a Next.js 16 app with Prisma 7 in a Docker container using oven/bun:1-alpine. The issue forced us to switch to Node.js + pnpm.
When running bun run dev (which invokes next dev with Turbopack, the default bundler in Next.js 16), Turbopack generates hashed external module references that Bun's runtime cannot resolve.
Error: Failed to load external module @prisma/client-2c3a283f134fdcb6/runtime/client:
ResolveMessage: Cannot find module '@prisma/client-2c3a283f134fdcb6/runtime/client'
from '/app/.next/dev/server/chunks/ssr/[root-of-the-server]__9504adac._.js'
The actual package is @prisma/client -- Turbopack appends a content hash (-2c3a283f134fdcb6) to the package name when marking it as an SSR external. Node.js resolves this correctly; Bun does not.
serverExternalPackagesin next.config.ts -- same error, Bun can't resolve hashed namestranspilePackages-- fixes@prisma/clientbut then the same issue cascades to@libsql/client, thenlibsql(native bindings). Whack-a-mole.- Removing
@prisma/adapter-libsqlentirely -- Prisma 7'sprisma-clientgenerator requires an adapter;new PrismaClient()without options throwsPrismaClientInitializationError --no-turbopack-- not supported in Next.js 16 (Turbopack is the only dev bundler)- Clearing
.nextcache and full container recreates -- no effect - Named Docker volumes vs bind mounts for node_modules -- no effect
Confirmed by a Next.js maintainer in vercel/next.js#86866:
"I recommend that you report this to bun" -- the problem doesn't occur with Node.js runtime, only with Bun's runtime when using Turbopack.
Also tracked in:
- vercel/next.js#87737 -- Turbopack generates external module references with hashes that don't match installed packages
- prisma/prisma#28956 -- Failed to load @prisma/client module with Next.js 15 + Bun + Turbopack
Switched from oven/bun:1-alpine to node:22-alpine in Docker. Using pnpm as the package manager. The same codebase works perfectly under Node.js -- Turbopack's hashed external references resolve correctly.
- Next.js 16.1.6
- Prisma 7.4.1 (prisma-client generator)
- @prisma/adapter-libsql 7.4.1
- Bun 1.3.9 (oven/bun:1-alpine Docker image)
- Linux x64 (Docker on VPS)
This is a complete blocker for using Bun as a runtime for Next.js 16 apps that use Prisma (or any package that Turbopack marks as an SSR external). The dev server simply cannot start. There is no workaround within Bun -- you must switch to Node.js.