Theo's Typesafe Cult

TTC

Theo's Typesafe Cult

Join the community to ask questions about Theo's Typesafe Cult and get answers from other members.

Join

how do you get the query string in next app dir api routes?

like on GET example.com/api/foo?bar=%22baz%22 i want to get { bar: "baz" }

Chirp Tutorial: tRPC failed on <no-path>:

Following along with the theo turtorial https://youtu.be/YkOSUVzOAA4?t=5612 I have my trpc.ts file nearly identical but I run into this error:
tRPC failed on <no-path>: You need to use "withClerkMiddleware" in your Next.js middleware file. You also need to make sure that your middleware matcher is configured correctly and matches this route or page. See https://clerk.com/docs/quickstarts/get-started-with-nextjs ...

await Prisma create never resolves using PlanetScale

I'm using Next API routes as my backend, and there is the logic inside: ```tsx if (req.method === "POST") { try {...

TRPC Internal Server Error

I keep getting this error, everything was working until I edited trpc.ts to make a private procedure. import { type CreateNextContextOptions } from "@trpc/server/adapters/next"; import { prisma } from "~/server/db";...

Prisma in next.js monorepo such as t3-turbo does not work

When I try to convert my create-t3-app to a t3 turbo monorepo (https://github.com/t3-oss/create-t3-turbo) I am hit with this issue from Prisma: https://www.prisma.io/docs/guides/other/troubleshooting-orm/help-articles/nextjs-prisma-client-monorepo Using the @prisma/nextjs-monorepo-workaround-plugin plugin results in a non-working app, so it is unusable. Has anyone gotten this to work?...

Fetching using useQuery based on changing state causes app to be too slow and throws an error

hello, i am trying to fetch data with a param based on the page the user is on ```ts export default function PcBuilderPartData({ component,...

planetscale

i have a few small projects and i want to use planetscale for all but you can only have 1 free database how would you all handle this or do you then use a self-hosted database...
Solution:
i have a few small projects and i want to use planetscale for all but you can only have 1 free database how would you all handle this or do you then use a self-hosted database...

Rendering a list pattern

I've been running into variations of this problem concerning the need to create an entirely new data constructs when needing to map through some data to render something: imagine I have an array of items stored as state: const [items, setItems] = useState<string[]>([]);...

prisma migrate remote database schema?

Hey there! Is there any best practices on how to migrate schema on remote database? Should I just connect to it manually and make migration?...

test

test
Solution:
this is the answer

handle onError mutation

want to show a toast when an error occured, so i copy and paste theo emoji project code but somehow still showing general error, any ideas thanks

What's everyone's favorite testing library for the T3 stack?

I'm trying to use cypress right now, but it's kind of a pain with the Discord auth. Does anyone have any other suggestions / tutorials I can look at to figure out how to get cypress set up with T3? I'm open to other testing libs too, I just want this to be easy lol

div inside a div - preventing complex onClick event propagation

I currently have the following component - ``` <div onClick={() => { // redirect to some other route }}> <div onClick={(e) => { e.stopPropagation(); setIsMenuOpen(true) }}>...

How can I 'sell' React to a workplace of dinosaur devs who hate javascript?

I work at a very large and old company where for various reasons, they're always at least 10 years behind on tech. Until a few years ago, their UIs were all in Java Swing, now they're trying to move to ExtJS. It's hell. Nobody has any motivation to improve their products, everyone is miserable and struggling with the awful tech, including me. It's like they don't know there are better options and refuse to look for them. I don't get it. I can quit, but I kinda want to just see if I can make any impact at all. How can I make my miserable, uninspired, dinosaur colleagues see the benefits of JavaScript, TS, etc.? They're currently in the mindset where they see something slightly unusual like () => {} and just mentally check out. It's infuriating. I'm probably the newest person there, and it's hard to be taken seriously when the next youngest person on my team is twice my age. Idk what replies I'm expecting, I guess I just wanted to rant....

constructing link with search parameters

So I have a navbar that links to a /results page. The situation is that if a user has preferences saved in localstorage, i want to embed those preferences within the link as search params like /results?sports=true&... currently, i have ```ts const appendParams = (path: PagePaths): PagePaths => { const searchParams = new URLSearchParams();...

Steam auth support.

Hello. I am new to t3 stack and to nextjs. I have always used reactjs and a nodejs or laravel rest api for my apps. I am trying to add steam authentication to my app. auth.js doesn't support steam anymore as a default provider. I have read some things about being able to add it as a custom provider, but i am not being able to do it. I was wondering if anyone knows a better way or could help me making this work. This is an application related to a steam game, so i really need that steam login......

next auth limitations with server rendering?

https://github.com/KairuDeibisu/wysark Here's the skinny, I'm using planet scale for my back end then prisma to connect it to next JS....

How to connect planetscale database using pgAdmin?

So I created a database in planetscale. Let's say the connection information looks like this... ``` database: mydb username: myusername...

What statistics/analytics service to use?

Hey! Im building a crypto wallet. We wish to track how many transactions get sent over time, how much volume happens over time,...

How do I solve for a persisting session on Next-auth when User is deleted from DB.

I am currently finding that My user auth sessions are persisted even when I have cleared my db. What is the cleanest way around this. If possible kindly share a solution when using the jwt strategy as well