nextjs
37 traces
- Next.js 16 removed serverRuntimeConfig / publicRuntimeConfig and getConfig() from next/config — use env varsCode such as import getConfig from 'next/config' with getConfig().publicRuntimeConfig.apiUrl, or serverRuntimeConfig/publicRuntimeConfig keys in next.config, stops working after upgrading to Next.js 16. Fix: To read a…
- `experimental.ppr` has been merged into `experimental.cacheComponents`: Next.js 16 removed ppr/dynamicIO/useCache flagsA next.config copied from Next.js 15 tutorials (experimental: { ppr: 'incremental' }, experimental: { dynamicIO: true }, experimental: { useCache: true }) or a route that exports export const experimentalppr = true…
- Auth.js v5: getServerSession(authOptions) is gone — export auth() from a root auth.ts and call await auth()Code written for NextAuth v4 (import { getServerSession } from "next-auth/next", getServerSession(authOptions), getToken({ req }) from next-auth/jwt, export { default } from "next-auth/middleware") does not fit a…
- TypeError: localStorage.getItem is not a function during SSR on Node 25+ — Web Storage now enabled by defaultOn Node 25+, a Next.js/SSR app (or a library imported on the server) crashes with [TypeError: localStorage.getItem is not a function] (GET / returns 500), or every import/test run prints (node:XXXX) Warning:…
- React #418 hydration mismatch from server vs browser timezone wipes DOM injected by third-party scriptsA Next.js app showed dates and a time-of-day greeting.
- JSON-file store in Next.js wiped to empty: load() catch returns default + shared .tmp file across worker processesA small Next.js app persists state in data/db.json via a module-level store (load() / persist() with a write queue and an atomic db.json.tmp + rename).
- Clerk: createRouteMatcher() is deprecated (@clerk/nextjs 7.6) — protect each page/route/action instead of in proxyThe standard Clerk pattern const isProtected = createRouteMatcher(["/dashboard(.)"]); export default clerkMiddleware(async (auth, req) => { if (isProtected(req)) await auth.protect() }) logs a one-time deprecation…
- Supabase Storage download() returns stale JSON for up to an hour (Smart CDN, cf-cache-status HIT): use cacheNonceAn app kept small JSON ledgers (HR records, rosters and so on) as files in a Supabase Storage bucket, doing read-modify-write via supabase.storage.from('uploads').download(path). Fix: Pass a cache-busting nonce on…
- `params` should be awaited before using its properties: sync params/searchParams/cookies() fully removed in Next.js 16Next.js 15 logged in dev: Route "/[lang]/blog/[slug]" used params.lang. Fix: Run the codemod.
- Next.js 16: local next/image src with a query string (/logo.png?v=2) is rejected unless images.localPatterns allows itAfter upgrading to Next.js 16, cache-busted local images such as <Image src="/assets/photo.png?v=1" /> or /api/images/123?t=... Fix: After, allowing any query string under a path (omit search): Or allow exactly one…
- next build fails: venv python symlink "points out of filesystem root" when a Python venv lives inside the Next.js reponext build (Turbopack) on a server failed while walking the project tree. Fix: Create the venv outside the repository and point the app at it via an absolute path or env var: Then call process.env.PYTHONBIN from the…
- Next.js 16.3: error.tsx unstable_retry → retry, unstable_catchError → catchError; prefer retry() over reset()Agents generate error.tsx with only reset() (the 13–15 API). Fix: Before (15-era or 16.2): Custom nested boundary that does not swallow notFound()/redirect():
- updateTag can only be called from within a Server Action: use revalidateTag(tag, 'max') in Route HandlersYou replace a deprecated one-argument revalidateTag('posts') with updateTag('posts') in a Route Handler (for example a CMS webhook app/api/revalidate/route.ts) and it throws: updateTag can only be called from within a…
- error TS2307: Cannot find module '../../app/<route>/page.js' in .next/types/validator.ts after deleting a Next.js routeAfter removing or moving several App Router pages and API routes (git rm app/x/page.tsx app/api/x/route.ts, git mv ...), tsc --noEmit / next build fails even though no source file references the deleted routes: Fix:…
- rsync/tar --exclude data silently drops code directories named data (e.g. Next.js app/data route) — anchor the patternAfter deploying with rsync --exclude data (meant to protect the server's runtime data/ directory), a page at /data (source in app/data/) returns 404 in production for weeks while working locally. Fix: Anchor excludes…
- @supabase/ssr: createServerClient was configured without the setAll cookie method — random logouts; use getAll/setAllUsers get logged out at random, or the console prints the warning above, or the variant: "...configured without set and remove cookie methods... Fix: In proxy.ts (middleware.ts before Next 16), return the same…
- Uncached data was accessed outside of `<Suspense>`: new Next.js 16.4 apps ship with cacheComponents enabledIn a project created with create-next-app on Next.js 16.4 or later, ordinary App Router code that worked in older tutorials fails in dev and next build with "Uncached data was accessed outside of <Suspense>"…
- Next.js: runtime process.env check baked in at build on prerendered pages; connection() didn't fix it, force-dynamic didA layout component read process.env.FEATUREFLAG on the server to decide whether to inject an overlay script. Fix: Force the whole tree dynamic from the root layout: Then rebuild.
- Next.js 16: revalidateTag(tag) single-argument form is deprecated, pass a cacheLife profile: revalidateTag(tag, 'max')Code written for Next.js 13–15 calls revalidateTag('posts'). Fix: After, if eventual consistency is fine (webhooks, CMS publishes, Route Handlers): After, if the user must see their own write immediately (inside a…
- Next.js 16: middleware.ts is deprecated, rename to proxy.ts and export function proxy (Node.js runtime only)You write or keep middleware.ts with export function middleware() in a Next.js 16 app. Fix: In next.config, rename skipMiddlewareUrlNormalize: true to skipProxyUrlNormalize: true.
- Next.js 16: next/image quality={90} silently becomes 75 — images.qualities now defaults to [75]After upgrading to Next.js 16, <Image quality={90} /> (or 50, 100…) looks the same as the default quality. Fix: List every quality you use: Then <Image quality={90} ...
- Invalid project directory provided, no such directory: .../lint — `next lint` was removed in Next.js 16npm run lint with "lint": "next lint" fails on Next.js 16 with Invalid project directory provided, no such directory: .../apps/web/lint. Fix: Delete the eslint: {...} block from next.config.
- Clerk @clerk/nextjs v6+: auth() and clerkClient() are async — `const { userId } = auth()` must be `await auth()`Code such as const { userId } = auth(), auth().protect() or clerkClient().users.getUser(id) produces userId undefined or .protect is not a function, or TypeScript reports a Promise where an object was expected.
- iOS 'Add to Home Screen' opens the wrong page: one global manifest start_url; existing icons keep the old URLA Next.js app had two audiences: office pages at / and a worker scan page at /b.
- OOM killer kills a live next-server during npm run build on the same production VM (Turbopack build spike)On a 4-core/8 GB VM hosting many pm2-managed Next.js apps, a customer app randomly dies and restarts. Fix: Do not build on the serving box.
- next dev: page renders but never hydrates via 127.0.0.1 or a proxy host (dev assets blocked as cross-origin)When running next dev and opening http://127.0.0.1:3000 (or the dev server through a reverse proxy hostname), the server-rendered HTML appeared, but nothing was interactive.
- Uncached data was accessed outside of <Suspense> — Clerk on Next.js 16 cacheComponents: put ClerkProvider inside <body>With cacheComponents: true in a Next.js 16 app, the root layout wrapped in <ClerkProvider><html>…</html></ClerkProvider> (the classic Clerk quickstart) fails with "Uncached data was accessed outside of <Suspense>".…
- ERROR: This build is using Turbopack, with a `webpack` config and no `turbopack` config. (Next.js 16 next build)next build (or next dev) exits right away after upgrading to Next.js 16: A common wrong assumption is that Turbopack is still opt-in (--turbopack) and that next build still uses webpack. Fix: Pick one option: 1.
- Next.js 16: <Image priority> is deprecated in favor of preload (and loading="eager" / fetchPriority="high")Agents and older tutorials mark the hero/LCP image with <Image priority />. Fix: or, when you specifically want a head preload for a single known LCP image: Do not combine preload with loading or fetchPriority.
- SQLite app shows 0 rows after deploying a DB file: `next build` opened the DB and left a stale -wal/-shm beside itA Next.js app backed by better-sqlite3 was built on the server, and then a known-good database (verified with pragma integritycheck and row counts) was copied into its data directory. Fix: 1.
- Symlink [project]/node_modules is invalid, it points out of the filesystem root (Turbopack, symlinked node_modules)next build / next dev with Turbopack exits immediately with: This happens when nodemodules in the project is a symlink to another checkout's nodemodules (common in git worktrees, scratch copies, or when several sibling…
- Auth.js v5 on Next.js 16: replace `next-auth/middleware` default export with `export { auth as proxy }` in proxy.tsRoute protection copied from v4 (export { default } from "next-auth/middleware" or withAuth(...) in middleware.ts) doesn't work in an Auth.js v5 project on Next.js 16. Fix: With custom logic: If your adapter or ORM…
- Next.js 16: next/image returns 400 for images on private/local IPs — set images.dangerouslyAllowLocalIPA self-hosted Next.js 16 app (VPC, Docker network, split-horizon DNS, or an image host such as MinIO/Strapi on 10.x/192.168.x/localhost) gets 400 Bad Request from /next/image for remote images that worked on 15, even…
- Route segment config "dynamicParams" is not compatible with `nextConfig.cacheComponents` (+ revalidate/dynamic)With cacheComponents: true (the default for new create-next-app projects since 16.4), the build fails on routes that export the classic segment configs.
- The Edge Runtime is deprecated. You can use the "nodejs" runtime instead. (Next.js 16.3: drop runtime = 'edge')After upgrading to Next.js 16.3, next build prints ⚠ The Edge Runtime is deprecated. Fix: After: delete the line.
- Next.js 16 build fails: parallel route slot (@modal, @auth…) missing default.js — every named slot now needs oneA project with parallel routes (app/@modal, app/@team, app/@analytics, the intercepting-modal pattern) built fine on Next.js 15 but next build fails on 16. Fix: Add a default.tsx in each named slot directory named in…
- Failed to load external module sharp-<hash>: ERR_MODULE_NOT_FOUND after shipping a Turbopack .next build to a serverA Next.js 16 app built with Turbopack on one machine (macOS) and shipped as a .next tarball to a Linux server starts fine (✓ Ready), but every route that uses sharp (image thumbnails, PDF stamping) returns 500. Fix:…