getStaticProps returning undefined in Nextjs

I’m working on a blog in Nextjs, and I want it to to fetch all of the blog posts from a directory on build. But no matter what I return with getStaticProps, it always returns undefined in the main component. I have tried it in both next dev and next build

//import Markdown from "react-markdown";
import styles from "./post.module.css";
import { promises as fs } from "fs";
import parse from "gray-matter";

const Post = ({ post, title, date, summary, image, test }) => {
    console.log(post) //returns undefined
    return (
        <div id={ styles.postcontainer }>
            <div id={ styles.post }>
            </div>
        </div>
    );
};

export default Post;

export const getStaticPaths = async() => {
    return {
        paths: [...(await fs.readdir("assets/markdown")).map(file => { return { params: { id: file.replace(".md", "") } } }) ],
        fallback: false
      }
};
  

export const getStaticProps = async(context) => {
    const post = await fs.readFile(`assets/markdown/${ context.params.id }.md`, "utf8");
    console.log(post) //success
    return {
        props: {
            post : parse(post).content,
            title : parse(post).data.title,
            date : parse(post).data.date,
            summary : parse(post).data.summery,
            image : `../assets/${ parse(post).data.image }`,
        }
    }
};

Im pretty sure that the issue isn’t with the data == undefined, because when I log it in terminal (inside getStaticProps) it responds with the correct values.

console.log(post)

---
title : test
slug : test
date : 3-9-22
summery : lorem ipsum
image : test.png

---

# Header 1

I’ve tried

props: {
            test : "testvalue123"
        }

but it still returns undefined in the main component. Thanks in advance!