export const getServerSideProps: GetServerSideProps = async ( context: GetServerSidePropsContext,) => { const { search: searchQuery = '' } = context.query const ssg = await generateSSGHelper(context) if (searchQuery?.length && searchQuery.length >= 1) { // `prefetch` does not return the result and never throws - if // you need that behavior, use `fetch` instead. await ssg.spotify.getSearch.prefetch({ searchQuery: searchQuery as string, }) } return { props: { // trpcState: ssg.dehydrate() }, }}
export const getServerSideProps: GetServerSideProps = async ( context: GetServerSidePropsContext,) => { const { search: searchQuery = '' } = context.query const ssg = await generateSSGHelper(context) if (searchQuery?.length && searchQuery.length >= 1) { // `prefetch` does not return the result and never throws - if // you need that behavior, use `fetch` instead. await ssg.spotify.getSearch.prefetch({ searchQuery: searchQuery as string, }) } return { props: { // trpcState: ssg.dehydrate() }, }}
I didn't return anything in the props because I was already getting an unserializable error that started after authenticating in in the ssgHelper. I would really appreciate any help!