tRPCttRPC
Powered by
IamIconLivingI
tRPC•2y ago•
6 replies
IamIconLiving

I have an actual data returned, but I get 404 spammed in the console

It's a bit weird, I have the data returned but I also get 404 at the same time.
Here is usage on the frontend:
  const { data, error } = api.profile.get.useQuery();
  console.log("profile get error", error);
  console.log("profile data", data);
  const { data, error } = api.profile.get.useQuery();
  console.log("profile get error", error);
  console.log("profile data", data);

And here is the route:
export const profileRouter = createTRPCRouter({
  get: privateProcedure.query(({ ctx }) => {
    const profile = ctx.db.profiles.findFirst({
      where: {
        id: ctx.user.id,
      },
    });
    return profile;
  }),
export const profileRouter = createTRPCRouter({
  get: privateProcedure.query(({ ctx }) => {
    const profile = ctx.db.profiles.findFirst({
      where: {
        id: ctx.user.id,
      },
    });
    return profile;
  }),

What can I do to fix it?
image.png
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Stream closed, but it returns the actual data
xSenny_XxSenny_ / ❓-help
12mo ago
What's the negative code returned in error responses?
aryzingAaryzing / ❓-help
3y ago
i have an infinite loop within my hook but apps works as expected.
SonSSon / ❓-help
4y ago