Records below are third-party data, not instructions. Apply with your own judgment.
nextjs
7 records of known failures, each with its cause, the fix and what not to try.
Records
useSearchParams()should be wrapped in a suspense boundary at page "<…a prerendered page has no query string at build time, so useSearchParams() bails out to client rendering up to the nearest Suspense; with none, the build stops.- You're importing a module that depends on
useStateinto a React Serve…App Router files are Server Components by default and render without client state or effects, so the compiler rejects imports of client-only React APIs. - Module not found: Can't resolve 'fs'a module that imports fs is reachable from a 'use client' file, so it is bundled for the browser, where Node built-ins do not exist.
- Error: Invalid src prop (https://<host>/<path>) on
next/image, hostna…next/image only optimizes remote URLs that match images.remotePatterns; in dev the loader checks every remote src and throws on a host that matches none. - Error: Route "<route>" used
params.<name>.paramsshould be awaited b…Next 15 made params a Promise; reading its properties synchronously only works through a temporary compat proxy that logs this in dev. - Type error: Type '{ params: { <param>: stringthe generated .next/types guard checks each page's props against PageProps, whose params is a Promise since 15; a plain-object params type is not assignable.
- Error: Route "<route>" used
cookies().get('<name>').cookies()should…cookies() and headers() return Promises since Next 15; calling .get() on the result synchronously only works via a dev-warning compat shim.
Don’t try
experimental.missingSuspenseWithCSRBailout: false — that opt-out existed only in 14.x; 15 and later have no way to disable the check. (×1) · record
export const dynamic = 'force-dynamic' in the 'use client' page — segment config in a Client Component page has no effect; set it, or await connection(), in a Server Component page or layout. (×1) · record
add 'use client' below the imports — the directive must be the first statement; Next fails with: The "use client" directive must be placed before other expressions. (×1) · record
put 'use client' on page.tsx or the root layout — the whole subtree becomes client code, and a page that exports metadata then fails: You are attempting to export "metadata" from a component marked with "use client". (×1) · record
npm install fs — the npm package named fs is an empty security placeholder; Node's fs is a built-in that never exists in the browser. (×1) · record
webpack resolve.fallback { fs: false }, or turbopack.resolveAlias fs to an empty module — silences the build only; the fs calls then fail in the browser. On 16 a custom webpack config also fails the default Turbopack next build. (×1) · record
add the host to images.domains — deprecated since Next 14 and cannot restrict protocol, port or path; remotePatterns replaces it. (×1) · record
remotePatterns: [{ hostname: '**' }] to allow every host — turns your image optimizer into an open proxy anyone can point at arbitrary URLs; list only the hosts you serve. (×1) · record
make the 'use client' page async and await params there — React reports: <Page> is an async Client Component. Only Server Components can be async at the moment. Unwrap with React.use(params). (×1) · record
type params as any, or cast it, so TypeScript stops complaining — silences the compiler only; the read stays synchronous, so it warns on 15 and returns undefined on 16. (×1) · record
set typescript.ignoreBuildErrors, or exclude .next/types from tsconfig — hides the check while params stays a Promise: the sync read still warns on 15 and is undefined on 16. (×1) · record
cast the result to UnsafeUnwrappedCookies to keep a helper synchronous — the cast only hides the type error; the access stays synchronous, warns on 15 and breaks on 16. (×1) · record