Hello, I'm having a bit of an issue currently and hope one of you can help me.
This is likelu not an issue on astro's end, but on mine, however I hope that I can still get the help I need.
---
import type { GetStaticPaths } from "astro";
import type { Reference } from "../../types/home";
import config from "../../config/references.yml";
const references: Reference[] = config.references;
export const getStaticPaths = (() => {
return references.map(reference => ({
params: {
project: reference.name.toLowerCase()
}
}));
}) satisfies GetStaticPaths;
const { project } = Astro.params;
---
The component above (/pages/references/[project].astro) gives me the following error: references is not defined (references/[project].astro:9:3).
I'm kind of confused, because I made sure the import is correct, and fetching the reference array is also not an issue in other components, such as here:
import type { Reference } from "../../types/home";
import config from "../../config/references.yml";
const references: Reference[] = config.references;
// ...
The component above (/components/home/References.tsx) has no issues using the references whatsoever