SimeonGriggs / sanity-nextjs-preview

Sanity Studio Visual Editing examples for Next.js 14 App + Pages routers
https://sanity-nextjs-preview-two.vercel.app
81 stars 19 forks source link

Error with npm run build #22

Open tomcodes opened 1 month ago

tomcodes commented 1 month ago

I am following this tutorial: https://www.sanity.io/guides/nextjs-app-router-live-preview (Last updated July 12, 2024)

Everything works fine during dev (npm run dev) but when I build I have this error:

./app/(pages)/(blog)/blog/[slug]/page.tsx:18:9
Type error: Expected 0 arguments, but got 3.

  16 | export async function generateStaticParams() {
  17 |     const posts = await client.fetch<POSTS_QUERYResult>(
> 18 |         POSTS_QUERY,
     |         ^
  19 |         {},
  20 |         { perspective: "published" }
  21 |     );

Any idea on how to solve this?