IamIconLiving
IamIconLiving5mo ago

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?
No description
4 Replies
IamIconLiving
IamIconLiving5mo ago
This is what I get in the console log spammed
No description
IamIconLiving
IamIconLiving5mo ago
But data is returned from the trpc route..
IamIconLiving
IamIconLiving5mo ago
it actually seems to be related to this issue https://github.com/trpc/trpc/issues/3081 In my codebase I was using unstable_httpBatchStreamLink and once I switched it to httpBatchLink I got the same error as described in 3081 issue
GitHub
httpLink/httpBatchLink on fetch redirect · Issue #3081 · trpc/trpc
Provide environment information System: OS: macOS 11.6.8 CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Memory: 610.94 MB / 32.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 18.11.0 - ~/.nvm/v...
IamIconLiving
IamIconLiving5mo ago
but as it's closed I am not exactly sure what I need to do to fix it Actually this is related to the fact that my entire app is under dynamic [lang] directory for the internalization, so my app url is foo.com/en If I move my up on the level up it works fine. How can I ensure this is not breaking with internalization? ... placed the api folder under my [lang directory, which caused the problem
More Posts
No "query"-procedure on path "auth.getProfile"I am getting bunch of these errors and I can't figure this one out yet. I saw bunch of issues createType '[]' has no properties in common with type 'MutateOptions<{ id: string....Is it possible to get this to work? i am trying to make a single action that works across 2 routers.Strange error when testing with Auth.js v5Hi there, I just created a fresh Next.js project and added `next-auth` version 5 beta for authentictRPC failed on beehiiv.fetchBeehiivPosts: Invalid state: Controller is already closedIs there any solution to this error. I am getting while I try to hard refresh a page where I am callIs there a way to configure a trpc router to require an output() schema to be specified?I would like to require the output() schema to be specified on all the queries and mutations in my pErrors not caught in proceduresI have an application that uses Solid Start `@solidjs/start`. Most Solid Start apps use the `fetchResilent failure on client query?Hey friends, long time listener, first time caller 😉 I have encountered a quite confusing quirk thaAuth0 + fastify + tRPCHi, I've inherited a tRPC React/fastify app and need to migrate the auth from supertokens to auth0.Getting the type of contextIs it possible to get the type on a context object that is passed into a specific TRPC procedure aftIs it possible to perform attribute-based authorization after the .query?I have a TRPC method, `getStudentGradeById,` that accepts the `gradeId`. I want to return the grade