nextjs - 💡(How to fix) Fix Turbopack + Vercel: hashed pino external alias is not resolvable at runtime

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error: Failed to load external module pino-2e79642258e38174: Error: Cannot find module 'pino-2e79642258e38174' Require stack:

  • /var/task/.next/server/chunks/ssr/[root-of-the-server]__0c3ufd7._.js
  • /var/task/.next/server/chunks/ssr/[turbopack]_runtime.js
  • /var/task/.next/server/app/(authenticated)/(org-selected)/(subscription)/todo/page.js
  • /var/task/node_modules/.pnpm/[email protected]_.../node_modules/next/dist/compiled/next-server/server.runtime.prod.js
  • /var/task/___next_launcher.cjs
  • /opt/rust/nodejs.js

Fix Action

Workaround

Building with Webpack avoids the issue:

{
  "scripts": {
    "build": "next build --webpack"
  }
}

Code Example

Error: Failed to load external module pino-2e79642258e38174:
Error: Cannot find module 'pino-2e79642258e38174'
Require stack:
- /var/task/.next/server/chunks/ssr/[root-of-the-server]__0c3ufd7._.js
- /var/task/.next/server/chunks/ssr/[turbopack]_runtime.js
- /var/task/.next/server/app/(authenticated)/(org-selected)/(subscription)/todo/page.js
- /var/task/node_modules/.pnpm/next@16.2.6_.../node_modules/next/dist/compiled/next-server/server.runtime.prod.js
- /var/task/___next_launcher.cjs
- /opt/rust/nodejs.js

---

require("pino-2e79642258e38174")

---

.next/node_modules/pino-2e79642258e38174 -> ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino

---

Next.js: 16.2.6
React: 19.2.4
Node: 22.x on Vercel
Package manager: pnpm
Bundler: Turbopack via default `next build`
Deployment: Vercel Serverless
pino: 10.3.1

---

const nextConfig = {
  serverExternalPackages: ["pino"],
};

---

{
  "scripts": {
    "build": "next build --webpack"
  }
}
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

I don't have a minimal reproduction yet, but this is happening in a production app deployed to Vercel.

To Reproduce

  1. Use Next.js 16.2.6 with the default next build command, which uses Turbopack in Next.js 16.
  2. Use pino from server-side code.
  3. Deploy to Vercel.
  4. Visit a server-rendered route that imports the server logger.

Current vs. Expected behavior

Current behavior

The Vercel deployment fails at runtime with a hashed external module name generated by Turbopack:

Error: Failed to load external module pino-2e79642258e38174:
Error: Cannot find module 'pino-2e79642258e38174'
Require stack:
- /var/task/.next/server/chunks/ssr/[root-of-the-server]__0c3ufd7._.js
- /var/task/.next/server/chunks/ssr/[turbopack]_runtime.js
- /var/task/.next/server/app/(authenticated)/(org-selected)/(subscription)/todo/page.js
- /var/task/node_modules/.pnpm/[email protected]_.../node_modules/next/dist/compiled/next-server/server.runtime.prod.js
- /var/task/___next_launcher.cjs
- /opt/rust/nodejs.js

The generated server chunk contains:

require("pino-2e79642258e38174")

In the local build output, .next/node_modules contains a symlink for that alias:

.next/node_modules/pino-2e79642258e38174 -> ../../node_modules/.pnpm/[email protected]/node_modules/pino

So the alias exists locally, but it does not appear to be resolvable inside the Vercel serverless runtime artifact.

Expected behavior

The Vercel runtime should be able to resolve the externalized pino package, or Turbopack should emit a runtime-resolvable external reference.

Environment

Next.js: 16.2.6
React: 19.2.4
Node: 22.x on Vercel
Package manager: pnpm
Bundler: Turbopack via default `next build`
Deployment: Vercel Serverless
pino: 10.3.1

Relevant next.config.ts:

const nextConfig = {
  serverExternalPackages: ["pino"],
};

Additional context

This seems related to, but not exactly the same as, the original Cannot find module './transport-stream' issue discussed in:

PR https://github.com/vercel/next.js/pull/86884 added pino-related packages to the automatic serverExternalPackages list, but this failure mode is different: the package is externalized, yet the generated hashed alias pino-<hash> is not resolvable at runtime on Vercel.

Workaround

Building with Webpack avoids the issue:

{
  "scripts": {
    "build": "next build --webpack"
  }
}

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

nextjs - 💡(How to fix) Fix Turbopack + Vercel: hashed pino external alias is not resolvable at runtime