nextjs-client-server-boundary-dns-error

Diagnose Next.js client/server boundary violations causing Prisma DNS errors.

9|2|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/DavidTeju/shared-skills --skill nextjs-client-server-boundary-dns-error
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-client-server-boundary-dns-error
Source: https://github.com/DavidTeju/shared-skills/tree/main/skills/nextjs-client-server-boundary-dns-error
Command: npx skills add https://github.com/DavidTeju/shared-skills --skill nextjs-client-server-boundary-dns-error

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Next.js builds can fail when server-only modules or Prisma bindings are bundled into client components, causing misleading DNS/module-resolution errors and broken client/server boundaries.

Core Features & Use Cases

  • Detects common client/server boundary violations such as barrel exports importing server code or client components importing Prisma enums.
  • Provides actionable, step-by-step fixes: import directly from component files, separate server utilities from client code, and avoid exposing server dependencies in client bundles.
  • Use cases include Next.js apps using Prisma with pg adapter, where build errors show client component browser traces.

Quick Start

Audit your Next.js project for server-only imports in client components and apply the recommended fixes.

Frequently Asked Questions about nextjs-client-server-boundary-dns-error

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my Next.js build fail with a DNS error when using Prisma?

Next.js builds fail with DNS errors when server-only Prisma modules leak into client component bundles. Importing Prisma bindings through barrel exports or using Prisma enums in client components violates the client/server boundary.

How do I fix Prisma client/server boundary violations in Next.js?

Fix Prisma boundary violations in Next.js by importing directly from component files, separating server utilities from client code, and configuring dependencies to exclude server code from the client bundle.

How do barrel exports break Next.js client and server component boundaries?

Barrel exports break Next.js client/server boundaries by bundling server-only modules into client components. When an index file re-exports both server and client code, importing it into a client component pulls server dependencies into the browser bundle.

Can I use Prisma enums in Next.js client components?

Using Prisma enums in Next.js client components causes client/server boundary violations because it pulls server-only Prisma bindings into the client bundle. Extract enum values into plain objects or shared types to keep the client bundle clean.

What is the best way to structure imports to avoid Next.js module resolution errors?

The best way to avoid Next.js module resolution errors is to bypass barrel exports and import directly from individual component files. This ensures server-only code is never accidentally bundled into client components.

Next.js Prisma DNS error not working, what are the limitations of barrel exports?

The limitation of barrel exports is they obscure module origins, causing Next.js to bundle server-only Prisma code into client components. You must separate server/client utilities and use direct imports to prevent these resolution errors.