Questions tagged [trpc]

67 questions
0
votes
0 answers

How to call publicProcedure inside Clerk middleware

I'm building a website using Typescript, Next and React. I'm using Prisma as ORM, tRPC to create the API, and Clerk for User Authentication. My goal is to avoid any non-logged user to enter certain pages, but also to avoid users without active…
Lotan
  • 4,078
  • 1
  • 12
  • 30
0
votes
2 answers

trpc error Input parser must be a ZodObject

I have the following input schema: const inputSchema = z.union([ z.object({ id: z.string(), }), z.object({ key: z.string(), }), ]) This schema works until I do: import { generateOpenApiDocument } from 'trpc-openapi' const…
HMR
  • 37,593
  • 24
  • 91
  • 160
0
votes
1 answer

"TypeError: getStaticPaths is not a function" error in Nextjs

First of I am new in Nextjs and making a blog project using T3 Stack (Nextjs, Typescript, Prisma, tRPC). I get an error like this when I want to pull the post content with the id. I will add my codes as well. I would be glad if anyone can help…
Kalkhos
  • 27
  • 4
0
votes
0 answers

Cant find subpackage with tRPC and WebSockets

I'm trying to use the websockets provided with trpc for a live chat. But when I follow the documentation and create the context as provided: import {NodeHTTPCreateContextFnOptions} from "@trpc/server/dist/adapters/node-http"; import {…
0
votes
1 answer

In T3 Stack project, I'm getting query logs in console of browser, How can I stop it?

I have T3 stack project and I'm fetching data using trpc and prisma, but It's showing logs in browsers console. How can I stop this logs?
0
votes
1 answer

tRPC api conditional calls invoke Error: Rendered more hooks than during the previous render

I'm trying to learn how typescript, react and tRPC behaves together, I've this page questions.tsx: import { NextPage } from 'next'; import { useRouter } from 'next/router'; import { QuestionCard } from '~/components/questionCard'; import { api }…
Lotan
  • 4,078
  • 1
  • 12
  • 30
0
votes
1 answer

How to Setup tRPC with Remix, Zod and Prisma

tRPC documentation has step by step guide for popular SSR framework like NextJS, but most of the example uses NextJS adapters and middle-ware. There's no documentation for setting it up with Remix which is yet another popular SSR React framework.
Mayank Pathela
  • 453
  • 1
  • 6
  • 15
0
votes
0 answers

Modify trpc error before sending the response

The documentation says "Here you can handle or change errors.". It then continues without any mention on how to actually do this. Searching for how to do this did not yield any results so I'm trying my luck here.
HMR
  • 37,593
  • 24
  • 91
  • 160
0
votes
1 answer

TRPC Multiple Inputs

I have a TRPC public procedure in my NextJS project. Currently one of the methods, I pass in the shopping cart of a customer, which is an array of objects. I want to add the user details in addition to the array of objects for the cart. I can't find…
0
votes
0 answers

Tanstack query loading many many times

I don't know why, but my trpc useQuery functions are loading up every time the user taps on my site or interacts with it. My code is very simple const { data: preUploadedImageUrls, isSuccess: fetchedPreUploadedImages } = …
Landmaster
  • 1,043
  • 2
  • 13
  • 21
0
votes
1 answer

Error while dealing with tRPC procedures "input needs to be an object when doing a batch call" ... even it is already an object

My code, as a part of a create-t3-app project in NextJs, tRPC and Prisma. import { TRPCError } from "@trpc/server"; import { z } from "zod"; import { env } from "~/env.mjs"; import { createTRPCRouter, publicProcedure } from…
argcast
  • 1
  • 1
0
votes
2 answers

NextJs with React + Unable to update the parent state value

I am new in NextJS and using the NextJs with React. So I am fetching the users list using trpc with useQuery. Then I am filter users lists based on user name. I have added the sample code but I have more logic in that. In below code when I click the…
RSKMR
  • 1,812
  • 5
  • 32
  • 73
0
votes
0 answers

What happens between a user clicking on`redirect URL` from one's email and `useVerificationToken()` call in a server in next-auth.?

I am creating a custom endpoint for resendEmailVerification that can be called in a client side using trpc. 1. This is my code on customresendEmailVerification endpoint: { const verificationTokenData = await…
Hitit
  • 420
  • 6
  • 21
0
votes
0 answers

Internal Server Error When Deploying T3 App to AWS Amplify

I am trying to deploy a T3 NextJS app using TRPC, TailWind and Next Auth to AWS Amplify but when it builds and deploys, it says "Internal Server Error" on the webpage. Here is a link to the page:…
0
votes
0 answers

Retrieving nested comments with recursion in Prisma raw query

I am working on a project where I need to retrieve nested comments along with their authors using Prisma raw queries. I have a Comment model defined in my schema, and I want to fetch all the comments related to a specific article, including their…
Ujen Basi
  • 11
  • 1
  • 2