Skip to content

[BUG] not-found.tsx is incompatible with static export — breaks next build #697

@AbhishekChamp879

Description

@AbhishekChamp879

Bug description
src/app/not-found.tsx exists in the codebase, but the project uses output: "export" in next.config.ts (static export mode). Next.js does not support not-found.tsx with static exports — it will cause the production build (next build) to fail.
This is explicitly documented as a critical rule in CLAUDE.md:
Static export: output: "export" is set in next.config.ts. This means: not-found.tsx is incompatible — reject PRs adding it . The file was likely introduced in a PR that bypassed this check.

Steps to reproduce

1 . Clone the repository
2 . Run bun install
3 . Run bun run build
4 . Build fails with a Next.js static export error related to not-found.tsx

Expected behavior
bun run build should complete successfully and output a static site to out/.

Actual behavior
The build fails because not-found.tsx is not supported in static export mode (output: "export"). Next.js static export does not generate a server runtime, so dynamic error pages like not-found.tsx cannot be rendered.

Browser and OS info

  • OS: All (build-time issue, not browser-specific)
  • Browser: N/A
  • Version: N/A

Video format (if relevant)

  • N/A — this is a build configuration issue, not a video processing issue.

Screenshots/screen recording

  • N/A — reproducible by running bun run build.

Metadata

Metadata

Labels

bugSomething isn't working correctlytype:bugBug fix

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions