discord-questions.trpc.io Open in urlscan Pro
76.76.21.22  Public Scan

Submitted URL: http://discord-questions.trpc.io/
Effective URL: https://discord-questions.trpc.io/
Submission Tags: phish.gg anti.fish automated Search All
Submission: On July 14 via api from DE — Scanned from DE

Form analysis 1 forms found in the DOM

<form class="w-full py-6">
  <div class="relative flex items-center space-x-2 mb-4 w-full"><input
      class="flex h-10 w-full rounded-md border border-slate-300 px-3 py-2 text-sm placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-slate-400 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:border-slate-700 dark:text-slate-50 dark:focus:ring-slate-400 dark:focus:ring-offset-slate-900 bg-inherit pr-16"
      placeholder="Search the tRPC community" type="search" value=""><button
      class="active:scale-95 inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-slate-400 focus:ring-offset-2 disabled:opacity-50 dark:focus:ring-slate-400 disabled:pointer-events-none dark:focus:ring-offset-slate-900 hover:bg-slate-200 dark:hover:bg-slate-800 dark:hover:text-slate-100 data-[state=open]:bg-transparent dark:data-[state=open]:bg-transparent h-10 py-2 px-4 absolute right-0 z-10 bg-inherit text-ao-black dark:bg-inherit dark:text-ao-white"
      aria-label="Search"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-5 w-5">
        <path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"></path>
      </svg></button></div>
</form>

Text Content

 * tRPC

 * Search Answer Overflow
 * 

 * Search Answer Overflow
 * Login




TRPC


MOVE FAST & BREAK NOTHING. END-TO-END TYPESAFE APIS MADE EASY.

Join Server


TRPC


MOVE FAST & BREAK NOTHING. END-TO-END TYPESAFE APIS MADE EASY.

Join Server


COMMUNITY QUESTIONS



❓-HELP

CHANNELS

❓-HELP

kevinka999
View on Discord
7/12/2023

HOW CAN I GLOBALLY SET A "MIDDLEWARE" CALLBACK FOR ALL ONERRORS ON MY REACT
QUERY CALLS?

this is a little specific but Im struggling on it

Im using the TRPC server as a BFF for my backend and for every call on the
client I'm sending a token so backend can authenticate it, when the token is not
valid anymore api return status code 403 (forbidden).

what I want to do in my FE is that every onError call I check the status to see
if it is forbidden and if it is I will redirect the user and do some stuff (like
remove the token from storage and redirect)

since Im...

kereru1
View on Discord
7/12/2023

UPGRADING FROM TRPC V9 AND NEXTJS V12. SHOULD I UPGRADE NEXTJS FIRST OR TRPC?

I have an app built from the tRPC + NextJS + Prisma starter, and I'd like to
upgrade from tRPC v9 and NextJS v12 to the respective latest versions. Does it
make any different whether I upgrade Next or tRPC first?
divmode
View on Discord
7/11/2023

PREFETCHINFINITE NOT WORKING WHEN INPUTS ARE DIFFERENT

Ive been trying to figure out why prefetching doesnt work when the inputs are
different between prefetchinfinite and infinitequery. Its works great when the
inputs are the same. Hoping someone can shed some light on this.



export const getStaticProps: GetStaticProps<
  PageProps,
  Query,
  PreviewData
> = async (ctx) => {
  const { preview = false, previewData = {} } = ctx;

  const token = previewData.token;
  const [settings, page = fallbackPage] = awai...

grifn_
View on Discord
7/10/2023

TRPC + APP DIRECTORY + SSR - CURRENT STATE?

What is the current state of the technologies working together with or without
SSR?
It looks like some work is/was being done around using tRPC with the new app
directory but its hard to tell if that work is completed or what is currently
supported or recommended.

Can I start a new Next.js project with the new app directory and tRPC and expect
to be able to utilize SSR for the RSC (React Server Components)? What problems
currently exist? If tRPC requests can't be handled during SS...
toadmilk.
View on Discord
7/10/2023

HYDRATION FAILED BECAUSE THE INITIAL UI DOES NOT MATCH WHAT WAS RENDERED ON THE
SERVER

Unhandled Runtime Error
Error: Hydration failed because the initial UI does not match what was rendered on the server.

Warning: Text content did not match. Server: "3/07/23" Client: "03/07/2023"

See more info here: https://nextjs.org/docs/messages/react-hydration-error



const PostPage: NextPage...

Marksmith
View on Discord
7/10/2023

REACT TSC STARTS CHECKING SERVER TYPES

My tsconfig files are different on the server and client. When I run "tsc" on
react client, It is trying to check AppRouter types from the server. Is it
possible to make him stop checking server types on compile?
makisuo
View on Discord
7/9/2023

NEXTJS 13 BUILD FAILING

Issue also seen in this PR  https://github.com/trpc/trpc/pull/4574 I found. None
of the webpack workarounds seem to work for me to get it building again. Any
updates on this?
ashishsurya
View on Discord
7/9/2023

GOOGLE OAUTH CALLBACK

any one help how to handle google oauth callbackurl using tRPC
Dominik
View on Discord
7/9/2023

INFERING QUERY/MUTATION CALLBACK OPTS PARAMETER

Hey 🙂

Thanks for your hard work on this awesome library.
I want to create tRPC router, but i want to pass query (or mutation) callback
from other part of the app. I am working with monorepo, and trpc router
definition will be stored as a package shared by server (which will provide
certain controllers implenetation) and frontend (which will infer type for
queries & mutations). Unfortunately I don't know how to properly infer query /
mutation parameter type:

Example:
.nickman
View on Discord
7/8/2023

TYPE HELPERS TO MATCH AVAILABLE PATHS

Given a router like this:


const appRouter = t.router({
  post: t.router({
    list: t.procedure
      .query(() => {
        // imaginary db...

gejsi
View on Discord
7/8/2023

BEST WAY OF HANDLING RECURRING EVENTS THROUGH NEXTJS AND TRPC

Hi, I'm working on a project that handles users' "bonuses" and I need to refill
these bonuses every day (so, every 24 hours).
The easiest solution that I was thinking uses sql events so that they would
modify the users table periodically.
However, I'm using PlanetScale which doesn't support stored routines (triggers,
procedures, events...).
What's the easiest solution to this problem with this stack? Probably cron jobs
are the way to go right?
What...
huperniketes
View on Discord
7/8/2023

ARE GET AND POST THE ONLY HTTP VERBS SUPPORTED?

I’d like to add a procedure to handle HTTP PUT.
zerovb
View on Discord
7/7/2023

QUERY PARAM IN EVERY CLIENT REQUEST

Hi !

Im wondering if there is a way to add query params in every request without
creating a custom fetch. I only need to forward one query param from the browser
URL to the trpc where my procedures are hosted plus the authorization header.
Would like to avoid adding a fetch middleware system.

thanks!
acronie
View on Discord
7/7/2023

NOT ABLE TO IMPLEMENT WEBSOCKETS WITH TRPC

import { applyWSSHandler } from "@trpc/server/adapters/ws";
import ws from "ws";
import { createTRPCContext } from "./api/trpc";


toadmilk.
View on Discord
7/7/2023

TYPE ERROR

TS2322: Type '{ name: string; bio: string; location: string; website: string; }' is not assignable to type '(Without<UserUpdateInput, UserUncheckedUpdateInput> & UserUncheckedUpdateInput) | (Without<...> & UserUpdateInput)'.   Object literal may only specify known properties, and 'bio' does not exist in type '(Without<UserUpdateInput, UserUncheckedUpdateInput> & UserUncheckedUpdateInput) | (Without<...>...

mikeylikesitxd
View on Discord
7/6/2023

IS THERE A WAY TO USE A MORE UPDATED VERSION OF REACT QUERY IN TRPC?

I'm trying to make sure that my tRPC is using the most up to date version of v4
but I don't know how I can make it use the most accurate version.
reador23
View on Discord
7/6/2023

EXPRESS + TRPC: HANDLE EXPRESS ERRORS FROM CLIENT

I currently have Express as backend and react on frontend.

I want to migrate gradually to tRPC + react query.

In order to do that I want to use the tRPC express middleware. I have tons of
express middleware that I want to continue using for now, as well as error
handlers.

The problem is that the tRPC client (trpc react query) does not recognize
express errors like custom session timeout, 401, etc, which is normal, so I get
the "Unable to transform response from server&q...
felipemaffezzolli
View on Discord
7/6/2023

QUERIES RUNNING ON SERVER EVEN THOUGH SSR IS SET TO FALSE

Queries are running on server side only despite the fact of setting ssr:false.
Besides that, the queries are not running on client side.
emilaleksanteri
View on Discord
7/5/2023

TYPEERROR: CLIENT[PROCEDURETYPE] IS NOT A FUNCTION

Has anyone encountered this error before? I'm trying to implement an adapter for
Auth.js that can communicate with my backend via tRPC proxy client but I keep
getting this error for some reason.
This is how i call my route:


import { client } from "../data"
export default function StorefrontApiAdapter() {
  return {
    async createUser(user) {
      const result = await client.authorization.createUser.mutate(user)
      return { ...user, id: result.i...

debaucus
View on Discord
7/4/2023

TRPC -USEINFINITEQUERY() REFRESHES ALL DATA WHEN AN INPUT IS VARIED, HOW TO USE?

So I have a TRPC infiniteQuery:



  const { data, fetchNextPage, hasNextPage } =
    trpc.server.getAll.useInfiniteQuery(
      {
        limit: 3,
        tag: page,
      },
      {
        getNextPageParam: (lastPage) =>
          lastPage[lastPage.length - 1]?.nextCursor ?? null,
      }
    );



As an example, for each 3 gathered, I increase the value of page by 1, when page
= 2, the page does a query, resets the pages content a...
Powered by
AnswerOverflow