# Next.js: Failed to compile. ./src/app/page.tsx 12:7 Error: 'x' is assigned a value but never used. @typescript-eslint/no-unused-vars

**Code:** `Failed to compile: ESLint errors during next build` · **Category:** Next.js · **Seen on:** Next.js, TypeScript

`next build` runs ESLint and fails the build on lint errors.

## Meaning

Fix the reported lint errors, or relax the rules in `.eslintrc`. To temporarily skip (not recommended) set `eslint: { ignoreDuringBuilds: true }` in `next.config.js` (Next ≤15) and fix lint in CI separately. Common ones: unused vars, `react/no-unescaped-entities`, `@next/next/no-img-element`, `react-hooks/exhaustive-deps` (warning).

## Common causes

- Unused variables/imports
- Unescaped quotes in JSX
- `<img>` instead of `<Image>` (warning)
- `any` types with strict rules
- Hooks dependency rules

## Quick fix

1. Fix the listed lint errors (file:line shown)
2. Adjust rules in `.eslintrc.json` if too strict
3. `eslint: { ignoreDuringBuilds: true }` only as a temporary escape

## Detailed fix by platform

### Next.js

1. `npx next lint --fix` fixes auto-fixable issues

## How to diagnose

1. **Rule** — Which ESLint rule?
2. **Fix** — Auto-fixable?
3. **Policy** — Lint in CI?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/nextjs/failed-to-compile-eslint-build)
