How do I revalidatePath from a trpc router?

TRPCClientError: Invariant: static generation store missing in revalidateTag /
I'm getting this error when I try to call revalidatePath from my trpc router.
import { z } from "zod";
import {
  createTRPCRouter,
  publicProcedure,
  protectedProcedure,
} from "@/server/api/trpc";
import { formSchema } from "@/pages/admin";
import { revalidatePath } from "next/cache";

export const gigsRouter = createTRPCRouter({
  getAll: publicProcedure.query(({ ctx }) => {
    return ctx.prisma.gigs.findMany();
  }),

  create: protectedProcedure.input(formSchema).mutation(({ ctx, input }) => {
    revalidatePath("/");

    return ctx.prisma.gigs.create({
      data: {
        ...input,
        date: new Date(input.date),
      },
    });
  }),

  delete: protectedProcedure
    .input(z.object({ id: z.string() }))
    .mutation(({ ctx, input }) => {
      revalidatePath("/");

      return ctx.prisma.gigs.delete({ where: { id: input.id } });
    }),
});
Solution
Ok solved it
Was this page helpful?