Description
The build is currently failing due to a type error in lib/system-prompt.ts at line 328. The error message indicates that the property map does not exist on type AboutContent | ProfileInfo | Education | Experience[] | Reference[] | BlogPost[] | Project[] and specifically points out that it does not exist on type AboutContent.
./lib/system-prompt.ts:328:54
Type error: Property 'map' does not exist on type 'AboutContent | ProfileInfo | Education | Experience[] | Reference[] | BlogPost[] | Project[]'.
Property 'map' does not exist on type 'AboutContent'.
326 |
327 | // Format work experience
> 328 | const workExperience = experiences ? experiences.map((exp, index) => `
329 | ### ${index + 1}. ${exp.title} at ${exp.company}
330 | - **Duration**: ${exp.startDate} to ${exp.endDate}
331 | - **Location**: ${exp.location}
Expected Behavior
The build should compile successfully without any type errors. The map function should be used only when experiences is an array.
Proposed Fix
- Investigate the type definition of
experiences to understand why it might be of type AboutContent (or other non-array types).
- Implement proper type checking or type guards to ensure that
.map is only invoked when experiences is actually an array.
- Alternatively, update the type definitions so that
experiences is typed correctly as an array where applicable.
Steps to Reproduce
- Clone the repository
Emlembow/ChatWithPortfolio from branch master at commit 11007f8.
- Run
npm install to install dependencies.
- Execute the build command:
npm run build.
Additional Context
This issue surfaces during the Next.js build process when formatting work experience in the system prompt.
Description
The build is currently failing due to a type error in
lib/system-prompt.tsat line 328. The error message indicates that the propertymapdoes not exist on typeAboutContent | ProfileInfo | Education | Experience[] | Reference[] | BlogPost[] | Project[]and specifically points out that it does not exist on typeAboutContent.Expected Behavior
The build should compile successfully without any type errors. The
mapfunction should be used only whenexperiencesis an array.Proposed Fix
experiencesto understand why it might be of typeAboutContent(or other non-array types)..mapis only invoked whenexperiencesis actually an array.experiencesis typed correctly as an array where applicable.Steps to Reproduce
Emlembow/ChatWithPortfoliofrom branchmasterat commit11007f8.npm installto install dependencies.npm run build.Additional Context
This issue surfaces during the Next.js build process when formatting work experience in the system prompt.