Have you tried using searchParams props?
const Home = async ({ searchParams }: SearchParams) => {
const { error_code } = await searchParams;
}
Link to their documentation: https://nextjs.org/docs/app/api-reference/functions/use-search-params#server-components