Slopcheck

Framework guide

Next.js code review: where AI-generated apps go wrong

Next.js is the default choice of every model that is asked to build a web app, which means a lot of Next.js now exists that was never reviewed. The failures cluster in the same few places, and most of them are structural rather than clever.

1. The server and client boundary has dissolved

The App Router made a distinction that matters: server components have no browser, client components have no secrets. AI-written code tends to put "use client" at the top of a page when the build complains, which quietly moves a whole subtree to the browser. The pages still render, so nothing looks broken. What has actually happened is that the data fetching, and sometimes the privileged call, now runs on the client.

Read for it deliberately. In a healthy app, "use client" sits on a small number of files near the edges of the tree. In a rushed app it is on most of them.

2. Secrets are exposed through the public prefix

Any environment variable beginning NEXT_PUBLIC_ is compiled into the JavaScript bundle and is readable by anyone who opens developer tools. The mistake is predictable: a variable needed in a component gets renamed with the prefix until it works, and an API key that should never have left the server starts shipping to every visitor.

Grep the repository for NEXT_PUBLIC_ and read each name. A Stripe publishable key is fine. A secret key or service role token is an incident.

3. Committed build output and cache

.next/ in the tree is common in AI-generated repositories because it was built locally and committed by accident after a .gitignore was never finished. It bloats the repository into hundreds of megabytes, makes diffs useless, and lets a stale build sit next to current source. The same applies to node_modules/ and any out/ directory from a static export.

4. Type checks and lint suppressed to make the build pass

A next.config with typescript.ignoreBuildErrors or eslint.ignoreDuringBuilds is the clearest single signal that the build was the goal and the code was the obstacle. It is a five-word change that removes the only automatic check the project had. Alongside it, count the as any casts and @ts-expect-error markers; a scattering is normal, a pattern is not.

5. No tests, and no story for one

Next.js apps are not hard to test — route handlers, server actions and plain components are all testable in isolation. Vibe-coded ones almost never are, because nothing was written to make them so. If the repository has a "test" script that exits with an error, you have found the whole strategy.

6. Unsafe HTML in a framework that warns you about it

dangerouslySetInnerHTML earns its name. It appears when someone needs to render rich text and skips the sanitiser, and it turns any stored user content into a script execution path.

How to review one in an afternoon

Count first: files, tests, type escapes, presence of .next or node_modules in the tree, and how many files carry "use client". Those five numbers tell you whether this is a codebase that can absorb a second developer, and they take minutes rather than days. Then read the money paths — auth, payments, data access — which is where a person is genuinely needed.

Get the counts

Slopcheck samples a public Next.js repository and reports the structural findings above, with the files behind each one. It is a heuristic scan rather than a code review: it reads at most 40 files, up to 80 KB each, does not run the app, and cannot see private repositories. It will not find every problem, and it does not claim to.

Scan a repository free

No signup, nothing stored, public repositories only.

Keep reading