uzzii-21 / astro-portfolio

This repo contains the source code for a personal portfolio website built with Astro, a framework for building fast and modern websites with your favorite frontend tools. The website showcases the developer's skills, projects, and contact information. The website is responsive, accessible, and SEO-friendly.

Home Page:https://astro-portfolio-uzair.vercel.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot destructure property 'title' of 'projectDetail' as it is undefined.

aryanjha256 opened this issue · comments

when labelling feature: false for a project then there is a showing:
Cannot destructure property 'title' of 'projectDetail' as it is undefined.

even whenever i try to add more than 6 projects this error occurs, without even using "feature" in info.ts as keeping it default as true

try replacing
const featureProjects = info.projects.map((project, index) => { if (project.isFeatured && index < 6) { return project; } });

with this

const featureProjects = info.projects.reduce((featureProjects, project, index) => { if (project.isFeatured && index < 6) { featureProjects.push(project) } return featureProjects },[]);

in pages/index.astro

it also worked for me to just replace
const featureProjects = info.projects.map(
with
const featureProjects = info.projects.filter(

can you create a PR for this ?