What this thread does
The problem
A Next.js upgrade leaves three unrelated failures in one terminal. Determine whether the failing step executes middleware, compiles CSS, or invokes ESLint before changing dependencies. This cluster covers triage and runtime/plugin wiring; full Tailwind and ESLint migrations are neighbouring jobs.
Version boundaries, checked 2026-10-20
| Component | Official scope | Consequence |
|---|---|---|
| Next.js | Proxy history lists Node middleware experimental in 15.2.0, stable in 15.5.0, and middleware renamed in 16.0.0 | Select configuration by installed major |
| Tailwind CSS | Upgrade guide, v3 to v4 | PostCSS integration moved packages |
| ESLint | v9 migration, 9.0.0 | Flat config became the default; eslintrc is not automatically found |
These are compatibility boundaries, not latest-release pins. Prices and licences were not assessed because they do not determine these fixes.
Which repair to choose
| Failing step | Inspect first | Repair |
|---|---|---|
| Middleware request | Import trace through auth or database dependencies | Remove Node-only imports from Edge or use supported Node middleware |
| CSS compilation | Loaded PostCSS configuration | Register the v4 PostCSS package |
| Lint invocation | Working directory and existing config | Locate or migrate the intended flat config |
Edge runtime and crypto
Exact message in Next.js discussion 62985, checked 2026-10-20.
Error: The edge runtime does not support Node.js 'crypto' module.
A transitive import can pull Node crypto into middleware even when your file never imports it. Follow the first application file in the trace. Next.js's error guide, checked 2026-10-20, recommends Edge-compatible APIs or dependencies.
Run pnpm list next --depth 0 and inspect middleware imports. If deployment requires Edge, split its entry point from Node-only auth/database code; choose Web Crypto only where its semantics fit. Preserve authorization in protected handlers too.
For Next.js 15.5 middleware on a Node-capable host, merge runtime: 'nodejs' into its existing exported config without losing the matcher. A minimal illustration is export const config = { runtime: 'nodejs' };. The versioned middleware docs, checked 2026-10-20, document this setting. For Next.js 16 follow the Proxy migration instead; Proxy defaults to Node and rejects that runtime option. Run pnpm exec next build, restart the app using its dev script, and test both allowed and denied requests to a matching route.
Do not stub crypto out, blindly add a polyfill, paste the middleware setting into proxy.ts, or replace token validation with a cookie-presence check. A passing build does not establish working authorization.
Tailwind registered directly in PostCSS
Exact leading sentence from discussion 15790 and Tailwind source, checked 2026-10-20.
Error: It looks like you're trying to use tailwindcss directly as a PostCSS plugin.
A v3 plugin registration is being used with v4. Run pnpm list tailwindcss @tailwindcss/postcss postcss --depth 0. For a project deliberately on v4, run pnpm add -D tailwindcss@4 @tailwindcss/postcss@4 postcss, review the lockfile, and replace the old registration in the PostCSS config actually used by the build. Minimal postcss.config.mjs, to merge with other required plugins:
export default { plugins: { "@tailwindcss/postcss": {} } };
The CSS entry should contain @import "tailwindcss"; and be imported by the app. Run pnpm exec next build, restart development, and inspect a known utility in the browser. Official PostCSS setup, checked 2026-10-20, documents the package, registration and CSS import.
Do not register both packages or install the similarly named @tailwind/postcss. Do not downgrade a deliberate v4 app merely to retain old config. If compilation passes but styling remains wrong, check CSS loading and the broader migration separately.
ESLint cannot locate flat config
Exact message in discussion 18806, checked 2026-10-20.
ESLint couldn't find an eslint.config.(js|mjs|cjs) file.
For ESLint 9, run pwd and pnpm exec eslint --version in the app package. Check for a config there or in an ancestor. If one exists, select it explicitly, for example pnpm exec eslint --config ./eslint.config.mjs ., substituting its actual path. If only .eslintrc.json exists, run pnpm dlx @eslint/migrate-config .eslintrc.json, inspect the output and required dependencies, then rerun ESLint. The migration guide, checked 2026-10-20, calls this output a starting point requiring review. For Next.js 16 invoke ESLint directly; its upgrade guide, checked 2026-10-20, describes the CLI migration.
Do not simply rename an eslintrc object, create an empty config that drops rules, disable lint in CI, or assume later ESLint majors use v9 lookup rules. Full parser/plugin/ignore migration belongs in the neighbouring draft.
Community evidence
- haocloo's Next.js report shows crypto imported through a database driver. leerob's accepted maintainer update describes experimental Node middleware. Checked 2026-10-20. Current advice above uses official versioned docs rather than assuming that historical status still applies.
- MartinAbilev's Tailwind report describes compilation recovering while styling still fails; GoulartNogueira supplies migration changes. Checked 2026-10-20. Fixing registration does not establish correct output CSS.
- SaiCode-OTH's ESLint follow-up quotes the missing-config message; the discussion also covers files outside the config base. Checked 2026-10-20. Selecting a config does not resolve separate ignore/base-path problems.
A prompt to give your agent
Read the linked official source for each error before proposing a fix; do not guess. Record installed versions, working directory and failing command. Follow the middleware import trace, identify the loaded PostCSS config and locate the intended flat config. Pick the matching repair, preserve auth checks and lint rules, change one layer at a time, then report build, protected-route and lint results separately with source links and checked dates.
Limits
No app was installed, built, linted or deployed. Community reports are historical and uneven, establishing symptoms rather than current incidence or AI-agent success. All three requested leading strings were verified; trailing traces and host-specific wording remain unverified. This cluster addresses their error-routing boundary, not their full migration scope.
Started from a post by @leerob, packaged by the editor. Original post