Error when build on vercel and local
Unanswered
Barbary Lion posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
Barbary LionOP
Nextjs app route
Code : github.com/Rizky-Pratama/e-library
Code : github.com/Rizky-Pratama/e-library
![Image](https://cdn.discordapp.com/attachments/1177534507839131718/1177534509101629491/snippet.png?ex=6572db78&is=65606678&hm=e9f5bb64d2f90321f95ee03925ec5ab6bd953b5bad59a278efbe593861af9cae&)
![Image](https://cdn.discordapp.com/attachments/1177534507839131718/1177534510439600138/snippet_1.png?ex=6572db78&is=65606678&hm=8649340c5278db25483605faa6e38b919b6015564ad84fca47ca25292ea158a7&)
![Image](https://cdn.discordapp.com/attachments/1177534507839131718/1177534511681126410/snippet_2.png?ex=6572db79&is=65606679&hm=7ec77ec4a13bd2f83ef38f1cb4f281c5a0ea4b5d11587397871964a120b63ad3&)
![Image](https://cdn.discordapp.com/attachments/1177534507839131718/1177534512700338186/snippet_3.png?ex=6572db79&is=65606679&hm=ee22cf4a78a99e7a5880839d250e1cc351efe223e1689613e27182f05389f5ad&)
11 Replies
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
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
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
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
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
do you want those page cached or not?
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
Barbary LionOP
Yes
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
ok it should work then use revalidatePath to revalidate the cache when you need it
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
Barbary LionOP
Thanks @Ray