Skip to content

typescript: ignoreBuildErrors: true silently suppresses all type errors in production builds — type safety fully disabled #64

Description

@tg12

Summary

next.config.mjs sets typescript: { ignoreBuildErrors: true }, which silently suppresses all TypeScript compilation errors during production builds. The codebase makes widespread use of any types across API routes. The result is that type-unsafe code is compiled and deployed to production without any indication that type checks failed. This defeats the entire purpose of using TypeScript and allows entire classes of runtime errors to reach production undetected.

Evidence

File: next.config.mjs:

const nextConfig = {
  typescript: {
    ignoreBuildErrors: true,   // ← ALL TypeScript errors silently ignored in production
  },

Examples of unsafe patterns that would normally surface type errors, visible across the codebase:

src/app/api/signals/route.ts:

allSignals.sort((a: any, b: any) => {   // 'any' defeats type safety on sort
  if (a.iranRelevance !== b.iranRelevance) { ... }

src/app/api/alerts/route.ts:

export async function POST(request: Request) {
  const { action, ...data } = await request.json();  // data is 'any', no schema validation
  const signals = data.signals || [];  // no type check on signals array
  for (const signal of signals) {      // signal is 'any', no shape validation
    const text = `${signal.title} ${signal.summary || ''}`.toLowerCase();

src/app/api/brief/route.ts:

const { signals } = await signalsRes.json() as { signals: Signal[] };
// cast without runtime validation — if JSON shape differs, runtime error

The combination of ignoreBuildErrors: true and pervasive any means:

  • Structural mismatches between API response shapes and consuming code are never caught.
  • Refactoring any type causes silent downstream breakage.
  • The CI/CD build green-lights broken TypeScript without warning.

Why this matters

TypeScript's value is entirely in its build-time guarantees. Disabling build errors means:

  1. Developer changes that break type contracts deploy silently to production.
  2. Any runtime crash from a type mismatch has no pre-production signal.
  3. npm run build completing successfully is meaningless as a quality gate.
  4. IDEs and editors still show errors, but they are ignored at build time — the flag actively trains developers to dismiss type errors.

Root cause

ignoreBuildErrors was added to make the build pass despite pre-existing type errors, rather than fixing the errors. This is a common vibe-coded shortcut that permanently disables type safety.

Recommended fix

  1. Remove typescript: { ignoreBuildErrors: true } from next.config.mjs.
  2. Run npm run build and address all type errors that surface.
  3. Replace all any typed function parameters and return values in API routes with explicit interfaces.
  4. Add strict: true to tsconfig.json and address remaining strict-mode errors.
  5. Add a CI step that fails the build on type errors: npx tsc --noEmit.

Acceptance criteria

  • ignoreBuildErrors: true removed from next.config.mjs.
  • npm run build completes with zero TypeScript errors.
  • No any annotations remain in API route handlers.
  • CI pipeline fails on TypeScript errors.

Suggested labels

bug

Priority

P0

Severity

High — TypeScript type safety entirely disabled in production builds; type errors deploy silently.

Confidence

Confirmed — flag is present in next.config.mjs in current HEAD.


This issue was filed as part of the AI Slop Intelligence Dashboard Awareness Program.
Repo under review: https://github.com/OpenScanAI/GlobeNewsLive
Programme: https://labs.jamessawyer.co.uk/ai-slop-intelligence-dashboards/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions