Skip to content

Re-enable TypeScript build errors and fix the 7 current failures #47

Description

@ameyypawar

next.config.ts disables both build-time safety gates. With typescript.ignoreBuildErrors set, next build succeeds while tsc --noEmit reports 7 errors, at least two of which have observable runtime consequences. Separately, eslint.ignoreDuringBuilds suppresses a linter that is not configured or installed in this project at all.

Location

  • next.config.ts:5-10
  typescript: {
    ignoreBuildErrors: true,
  },
  eslint: {
    ignoreDuringBuilds: true,
  },

Current npm run typecheck output (clean tree, 7 errors)

src/app/community/[communityId]/page.tsx(126,16): error TS2604: JSX element type 'community.icon' does not have any construct or call signatures.
src/app/community/[communityId]/page.tsx(126,16): error TS2786: 'community.icon' cannot be used as a JSX component.
  Its type 'ElementType<any, keyof IntrinsicElements> | undefined' is not a valid JSX element type.
    Type 'undefined' is not assignable to type 'ElementType'.
src/components/settings/SettingsContent.tsx(94,27): error TS2339: Property 'metadata' does not exist on type 'UserProfile'.
src/components/settings/SettingsContent.tsx(95,41): error TS2339: Property 'metadata' does not exist on type 'UserProfile'.
src/components/settings/SettingsContent.tsx(201,31): error TS2339: Property 'metadata' does not exist on type 'UserProfile'.
src/components/settings/SettingsContent.tsx(201,92): error TS2339: Property 'metadata' does not exist on type 'UserProfile'.
src/lib/services/searchService.ts(163,9): error TS2353: Object literal may only specify known properties, and 'createdAt' does not exist in type 'Event'.

On the ESLint flag

There is no .eslintrc* and no eslint.config.* anywhere in the repository, and eslint appears in neither dependencies nor devDependencies. The "lint": "next lint" script therefore has nothing to run. ignoreDuringBuilds: true is suppressing a linter that was never set up, which makes the flag misleading — it reads as "we know about lint failures and chose to ship" when the real state is "lint has never run".

Why this matters

Two of the flagged errors are live defects, not type noise. The four SettingsContent errors are why "Member Since" and "Last Sign In" render "N/A" for every user. The searchService error is the visible symptom of the Event type not matching what the app actually stores, which is masked elsewhere by as unknown as Event casts.

With the gate off, CI cannot catch the next one — and both existing bugs reached production precisely because the compiler was told to stay quiet.

Suggested fix

  1. Fix the 7 errors first — each has a companion issue: the TS2604/TS2786 pair is the optional Community.icon, the four TS2339 are the UserProfile.metadata access, and the TS2353 is the missing createdAt on Event.
  2. Remove the typescript block from next.config.ts:5-7 so next build fails on type errors again.
  3. For ESLint, either install and configure it (eslint, eslint-config-next, and a config file) and then remove the eslint block, or drop both the eslint block at :8-10 and the unused "lint" script. Leaving a suppression flag for a linter that does not exist is the one outcome to avoid.
  4. Add npm run typecheck to CI so the gate is enforced on every push, not just at build time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions