Skip to content

Build fails: Type error in system-prompt.ts – 'experiences' is possibly 'null' #9

Description

@Emlembow

Build Failure: TypeScript Error in ./lib/system-prompt.ts

Error Details

  • File: ./lib/system-prompt.ts
  • Line: 328
  • Error: Type error: 'experiences' is possibly 'null'.

    const workExperience = experiences.map((exp, index) => ... )

Build Log Excerpt

[11:39:35.514] ./lib/system-prompt.ts:328:28
Type error: 'experiences' is possibly 'null'.
  328 |     const workExperience = experiences.map((exp, index) =>  ... )

Suggested Fix

Add a null check for experiences before calling .map, e.g.:

const workExperience = experiences ? experiences.map((exp, index) => ...) : [];

Notes

  • This error causes the Vercel build to fail.
  • Please ensure experiences is always an array (not null) before mapping.
  • If experiences can be null, provide a fallback (empty array or handle appropriately).

Steps to Reproduce:

  1. Trigger a build (e.g., via Vercel or npm run build).
  2. Observe failure caused by the above type error.

Build Environment:

  • Next.js: 15.2.4
  • Node: (see builder's default)
  • Vercel CLI: 42.2.0

If more info is needed, check the last build logs or ask for full logs from the Vercel dashboard.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions