Configuration
serverExternalPackages
Opt selected dependencies out of Server Component bundling so the Node host resolves them natively. This is useful for packages relying on Node-specific loading or native resources. It is not a way to make Node dependencies available in Edge or browser code. External packages must be deployed and compatible with the host. Example context: Next.js 16.x documentation lane; illustrative snippet or file tree, not executed. Exact candidate patch 16.4.6 remains unverified. Expected behavior / verification: Inspect a production artifact and start it in a clean fixture with the exact dependency. Confirm the intended package loads and that missing native assets fail visibly.
Formal Syntax & Structure
nextjs syntaxnextjs
serverExternalPackages: string[]Working Example
Example Snippetnextjs
// Illustrative: assumes a reviewed installed Node-only packageimport type { NextConfig } from 'next';const config: NextConfig = { serverExternalPackages: ['@river/native-reader'] };export default config;