Nextjs14 server actions error handling easy trick for developers
Unanswered
Crazy ant posted this in #help-forum
Crazy antOP
Hello everyone, Please help me with server actions error handling easy tricks when we deployed site to vpc. In my case I did not show toast error message since for user these kinds of messages are not required. So most of the time I console these errors. But when we deploy site to vpc , then it will be very difficult to trace them. Tracing is easy with vercels runtime error logs. But I deployed my application to AWS EC2, so I have to access EC2 instance and then track the error log. Do anyone knows any easy way out. I asked above question because when I was going to access dynamic page with live server , it throws error because I used generateStaticParams in the dynamic page. But in localhost it does not give any error also during building the app it did not throw that error. However, I rectified the error .
export async function generateStaticParams(){
const {users} = await fetchusers()
return users.map(({_id})=>_id)
}