When rendering page.js in next js, getServerSideProps is not working correctly. H1 tag is empty and 'test' is not logged to the console for this code inside app/page.js:
export const getServerSideProps = async () => {
console.log('test')
return { props: { data: 'test' } }
}
export default async function Home({ data }) {
return (
<main>
<h1>{data}</h1>
</main>
)
}
Any idea what the problem might be?
I have tried restarting the server, opening in incognite browser and replacing getServerSideProps with getStaticProps which didnt change anything.