Skip to content

TypeScript debt: 12 errors silenced by ignoreBuildErrors flag in admin next.config #518

Description

@tayebmokni

Summary

`apps/admin/next.config.ts` was set with `typescript: { ignoreBuildErrors: true }` + `eslint: { ignoreDuringBuilds: true }` to unblock the docker build through cascade-merged PRs' type debt. 12 TS errors in 3 files are now hidden from `next build`:

`media/[id]/MediaDetailClient.tsx` (8 errors)

TS2339: properties `hls_url`, `has_extracted_text`, `is_proxied`, `source_url` don't exist on `MediaAsset` — at lines 325, 326, 327, 342, 369, 374, 376. The component reads fields the type doesn't declare.

`media/[id]/MediaDetailClient.test.tsx` (3 errors)

TS2353: same 3 unknown properties in fixture literals.

`appearance/menus/MenusClient.tsx:157:32` (1 error)

TS2345: `MenuItem | undefined` not assignable to `MenuItem` — array index unsafety from `noUncheckedIndexedAccess`.

Fix

  1. Update `MediaAsset` type in `apps/admin/src/app/(authenticated)/media/types.ts` to declare the actual fields the API emits (hls_url, is_proxied, etc.) — likely already partially done from earlier work.
  2. In MenusClient.tsx, guard the array index with a null check.
  3. Once all 12 are resolved: delete `ignoreBuildErrors` + `ignoreDuringBuilds` from next.config.ts.
  4. Verify CI's `pnpm lint` and `pnpm test` (which bypass next.config) still pass; the flags only mask `next build`.

Note

Also need to fix the 2 react/no-unescaped-entities errors at `apps/admin/src/app/(authenticated)/posts/[id]/page.tsx:237` introduced this session — separate small task.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions