DelvisD
tRPC4y ago
Delvis

SSG on nextJS when appRouter is made with fastify adapter?

export const getStaticProps: GetStaticProps = async () => {
  const ssg = await createSSGHelpers({
    router: appRouter //This app router is in fastify
    ctx: await createContext(),
  });

  await ssg.fetchQuery("personalStats");
  await ssg.fetchQuery("ageOfOnsetPsychosisByGender");
  await ssg.fetchQuery("PsyLengthByGender");

  return {
    props: {
      trpcState: ssg.dehydrate(),
    },
    revalidate: 1,
  };
};


Anybody used next SSG with fastify adapter? If try to import appRouter from fastify to getStaticProps router in nextjs, I get webpack loader problems. How should I approach getting this to work?
Was this page helpful?