Rendering error: 'Cannot read properties of undefined (reading 'attributes')' in Astro (combined with Strapi)

System Information
  • Strapi Version:
  • Operating System:
  • Database:
  • Node Version:
  • NPM Version:
  • Yarn Version:

0

I try to import ‘days’ i made in strapi, in Astro. I allready did it with ‘tags’ and with events. I don’t know what is going wrong this time.
Here is an image of the error:
Error

This is the code in Filter.astro:

---
const { event, day, } = Astro.props;
import SpeakerList from "../components/SpeakerList.astro";


---
<section class='schedule'>
    <h1>schedule</h1>
    <div class='dates'>
      <p>June - 28th</p>
      <p>June - 29th</p>
      <p>Contiously</p>
      <ul class="tag">
        {event.attributes.days.data.map((tag) => (
            <li key={day.id}>{day.attributes.date}</li>
          ))}
      </ul>    
    </div>
    <SpeakerList />


</section>

and this is the code in SpeakerList.astro

---
import fetchApi from "../lib/strapi";
import SpeakerListCard from "../components/speakerListCard.astro";

const events = await fetchApi({
  endpoint: "events", 
  wrappedByKey: "data", 
  query:{
    populate: ["image", "tags" , "days"]
}});

const tags = await fetchApi({
  endpoint: "tags",
  wrappedByKey: "data",
});

const days = await fetchApi({
  endpoint: "days",
  wrappedByKey: "data",
});

console.log(events);

---

<ul>
    {
      events.map((event) => (
        <li>
          <a href={`/events/${event.id}`}>
            <SpeakerListCard event={event} />
          </a>
        </li>
      ))
    }

</ul>

And the Json structure is right here:
Json

I tried it with dummy code that allready does work (tags) but the same error occured…