# Next.js: Failed to compile. ./src/app/page.tsx:15:9 Type error: Type 'string | undefined' is not assignable to type 'string'

**Code:** `Type error during next build` · **Category:** Next.js · **Seen on:** Next.js, TypeScript

TypeScript type checking failed during `next build`, which blocks the deployment.

## Meaning

Fix the type errors reported (file:line). Dev server doesn't block on types, so errors first surface in build/CI. Run `npx tsc --noEmit` locally to see them all. Avoid `ignoreBuildErrors: true` except as an emergency measure.

## Common causes

- Possibly undefined values (strict null checks)
- Wrong prop types
- Missing types for libraries (`@types/*`)
- Next 15 async `params` type changes
- Version upgrades changing types

## Quick fix

1. `npx tsc --noEmit` locally and fix errors
2. Install missing `@types/...`
3. Narrow values (`if (!x) return`) before use

## Detailed fix by platform

### Next.js

1. `npx tsc --noEmit --pretty`

## How to diagnose

1. **Error** — File and line?
2. **Strict** — Null checks?
3. **Types** — @types installed?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/nextjs/type-error-during-build)
