Next.js documented errors
Browse documented Next.js errors with exact messages, troubleshooting context, and practical remediation steps.
Build
Build errors
app/ Static to Dynamic ErrorNext.js app static to dynamic rendering errorA route that was generated statically at build time is trying to use dynamic server values such as cookies or headers at runtime, which Next.js does not allow for that route mode.
Static Bail Out CaughtNext.js caught a Partial Prerendering bailout errorWhen Partial Prerendering is enabled, Next.js throws a special bailout error for dynamic APIs like cookies, headers, or no-store fetches, and catching that error breaks static generation.
Conflicting SSG PathsNext.js getStaticPaths returned conflicting pathsNext.js found duplicate or overlapping static paths returned by getStaticPaths, which is invalid because every generated page path must be unique.
No Document Import in PageNext.js imported next/document outside _documentNext.js found next/document imported in a page outside pages/_document, which is unsupported and can cause unexpected application behavior.
Build Errors
Build Errors errors
Module Not FoundNext.js module not found during build or runtimeNext.js could not resolve an imported module, usually because the package is missing, the path is wrong, the casing is inconsistent, or a server-only module was imported in an unsupported place.
Page Without Valid React ComponentNext.js page does not export a valid React componentNext.js found a page file that does not export a valid default React component, which breaks rendering and build analysis.
Prerender ErrorNext.js prerender error during buildNext.js hit an error while prerendering a page during next build, usually because a page depends on browser-only APIs, missing props, or incorrect static generation setup.
Static page generation timed out after multiple attemptsNext.js static page generation timed outNext.js retried static page generation jobs after workers stopped making progress, but one or more jobs kept hanging until the build failed with a timeout.
Configuration
Configuration errors
Invalid next.config.jsNext.js configuration contains invalid optionsNext.js detected invalid configuration keys or values in next.config.js, often because of typos, removed options, or values of the wrong type.
next.config.js Loading ErrorNext.js could not load next.config.jsNext.js failed while loading next.config.js or next.config.mjs, usually because of a syntax problem or an import that is not available in the current Node.js environment.
Invalid i18n configNext.js invalid i18n configurationNext.js found an invalid i18n configuration in next.config.js, such as an unsupported shape, too many locales, or inconsistent domain settings.
Invalid images configNext.js invalid images configurationNext.js detected an invalid images configuration in next.config.js, often because image settings use unsupported values, invalid limits, or malformed patterns.
Invalid Layout or Page ExportNext.js invalid layout or page exportNext.js found a layout or page file exporting a field that is not allowed in the app directory, such as a custom export instead of a supported segment option.
Invalid use server valueNext.js invalid use server export valueNext.js detected a use server file exporting something other than async functions, which is invalid because Server Actions must be declared as async exports.
Invalid webpack resolve aliasNext.js invalid webpack resolve alias overrideNext.js detected a custom webpack resolve.alias override that replaced internal aliases instead of extending them, which breaks framework internals during build.
Built-in next/fontNext.js still using the deprecated @next/font packageNext.js detected that the deprecated @next/font package is still installed or imported even though next/font is built into the framework.
Rendering
Rendering errors
No async Client ComponentNext.js client component cannot be asyncNext.js detected a Client Component declared as an async function, which is unsupported because React Client Components cannot be async.
createContext in a Server ComponentNext.js createContext used in a Server ComponentNext.js detected React context creation inside a Server Component, which is unsupported because createContext only works in Client Components.
Missing Root Layout tagsNext.js root layout is missing html or body tagsNext.js found a root layout that does not include the required html and body tags, which are mandatory in the App Router root layout.
Runtime
Runtime errors
href Interpolation FailedNext.js href interpolation failed for a dynamic routeNext.js could not build a dynamic route URL because not all required route parameters were supplied to Link, Router.push, or Router.replace.
Invalid href passed to routerNext.js invalid href passed to Link or routerNext.js detected a non-internal URL being passed to next/link or router navigation, which is unsupported because the Next.js router is only for internal routes.
Link passHrefNext.js Link wrapper is missing passHrefNext.js detected a Link wrapping a custom anchor-like component without passHref, which prevents the child anchor from receiving the href attribute.
No Router InstanceNext.js router method called during prerenderingNext.js detected router methods such as push, replace, or back being called while prerendering on the server, where no client router instance exists.
NextRouter was not mountedNext.js useRouter was used without a mounted Next routerNext.js reported that useRouter was called outside the expected router context, which commonly happens in unit tests or when next/router is used inside the app directory.