Error when build on vercel and local
Unanswered
Barbary Lion posted this in #help-forum

Barbary LionOP
Nextjs app route
Code : github.com/Rizky-Pratama/e-library
Code : github.com/Rizky-Pratama/e-library




11 Replies

you can't call the route handler at build time
just run the db operation on server component
use route segment config or unstable_cache to config the cache

Barbary LionOP
Is just adding ?
export const dynamic = 'error'
export const revalidate = false
export const fetchCache = 'force-cahce'
In
/(auth)/signout/page
/(create)/add/book/page
/(create)/add/transaction/page
/(dashboard)/dashboard/books/page
/(dashboard)/dashboard/category/page
/(dashboard)/dashboard/page
/(dashboard)/dashboard/staff/page
/(dashboard)/dashboard/transaction/page
/(dashboard)/dashboard/users/page
export const dynamic = 'error'
export const revalidate = false
export const fetchCache = 'force-cahce'
In
/(auth)/signout/page
/(create)/add/book/page
/(create)/add/transaction/page
/(dashboard)/dashboard/books/page
/(dashboard)/dashboard/category/page
/(dashboard)/dashboard/page
/(dashboard)/dashboard/staff/page
/(dashboard)/dashboard/transaction/page
/(dashboard)/dashboard/users/page

do you want those page cached or not?

Barbary LionOP
Yes

ok it should work then use revalidatePath to revalidate the cache when you need it

Barbary LionOP
Thanks @Ray