Next.js Discord

Discord Forum

request not rendering and client making extra requests

Unanswered
Spotted Sandpiper posted this in #help-forum
Open in Discord
Spotted SandpiperOP
When I put my code into production the next router does not push. I also noticed it was making some extra requests. I am trying to render the dhasboard. here is my code

const Page = () => {
  const router = useRouter();

  const searchParams = useSearchParams();
  const origin = searchParams.get("origin");

  trpc.authCallback.useQuery(undefined, {
    onSuccess: ({ success }) => {
      if (success) {
        router.push(origin || "/dashboard");
      }
    },
    onError: (err) => {
      if (err.data?.code === "UNAUTHORIZED") {
        router.push("/sign-in");
      }
    },
  });


the router is not pushing

8 Replies

Spotted SandpiperOP
And now the client is making extra request
+ not rendering the dashboard
Spotted SandpiperOP
using nextjs 14
+trpc
Spotted SandpiperOP
Didn’t really have any time to mess around
I will let you know if I figure it out
I think it’s a next js 14 issue