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

Drizzle type question

I swapped over to Drizzle, and I've got this schema right ```ts export const User = mysqlTable('users', { id: serial('id').primaryKey(),...
Solution:
And limit 1 still returns an array btw. So you have to do data[0].sessions

Drizzle ORM schema not working

Hey all, I have a drizzle orm schema and I can't really understand the error message, could someone please help? its connected to a planetscale db scheme: ```ts export const timesheets = mysqlTable("timesheets", { id: serial("id").primaryKey().autoincrement(),...

Video tag doesn't show up on iPhone.

Hey, so, yeah like the title says.. Video doesn't show. At all. You can see it on https://www.seve17.co on your iPhone. I tried with video tag and div with a dangerouslySetInnerHTML. Both of them don't work. ...

How to import images in NextJS and t3-turbo?

When importing it the way NextJS recommends you do I get a type error as shown in the picture below.
the way NextJS recommends https://nextjs.org/docs/app/building-your-application/optimizing/images#local-images
...

Multiple Server Components in a Client Component??

This looks straight forward at the beginning, but i;m finding it difficult constructing the files for this.... So i'm using shadcn Tabs component (which is a client component) and i need to render different server components under the tab content, check the below code for reference...

getting keyValidator._parse is not a function in t3-env

I have set up t3-env in my Next.js 13 project, but when I run my project, I encounter the following error:
keyValidator._parse is not a function
TypeError: keyValidator._parse is not a function
keyValidator._parse is not a function
TypeError: keyValidator._parse is not a function
...

the URL must start with file:

Can smbdy tell me why am I getting this error?
Solution:
well, i was trying while my server was running lol

Import error

How can I import useMutation()?
Solution:
you do use -> api.someRouter.someMutation.useMutation()

Why do I get this error? `Error: result.map is not a function`

Here is my code: ```import { use } from "react"; import { TMovie } from "../api/movies/types/MovieTypes"; import { MovieCard } from "./MovieCard";...

How do you revalidateTag or revalidatePath with a server component prisma fetch or server action?

I am not using next.js fetch out of the box, just a prisma get. How do I revalidate it with a tag or even the whole path when I submit a form? Next.js examples are all based on the fetch() and/or api route.
Solution:
Nevermind, it was more straightforward than I assumed - I just added revalidatePath('/path/path); to my prisma update server action.

[next-auth][error][JWT_SESSION_ERROR]

Solution:
Read the error message. It has 1) Link to the page in the docs you need 2) A place in the file where this error occurred (auth.ts line 106) 3) What the error is (You did something.id, when something is undefined)...

How would I go about using Cloudflare R2

I'm just looking around at options, with the main 3 being uploadthing, aws s3 and cloudflare r2. R2 seems to have better pricing overall, but I'm not too sure how to go about integrating it with a ct3-app. The docs say to use amazon aws s3, but I haven't found many open source repos that use R2 in which I can have a better look at. If anyone has some experience with this could you link me to some guides maybe?

Adding Tailwind to existing ct3a app

Hello! Quick quesiton, I already have a functioning ct3a app that i'm working on that I setup without selecting tailwind in the create app wizard. Should I just follow the docs on the tailwind website for nextjs (https://tailwindcss.com/docs/guides/nextjs) to set it up? Or is there anythign specific to ct3a that i'm missing out on? Thanks in advance....

Problem with page navigation using next/link

try to click the login button and than go back using the back button to understand my problem https://colibri-dr3kne2f6-spcbfr.vercel.app/...
Solution:
figured it out I had the replace attribute on my Link tag

How to store and retrieve many-to-one records in a table of "messages" given a "server".

The "messages" and "server" are just analogies of the situation. Suppose we have a "servers" table and "messages" table where each server has certain messages in the messages table. How would I be able to efficiently store each server's messages in a way that would make it easier and faster to retrieve it in the future instead of having to go through the whole table (which would be done if I used "where") in order to retrieve the necessary messages?

How to use only backend part of T3

How can we only use backend part of the T3 stack with t3-app (without Next.js and pages folder). Deleting the pages folder only gives an error.

Vercel logic of deployment

I'm using Vercel for the first time and I try to grasp the logic of deployment. So far, my deployment workflow was as follow (before Vercel): - I have a GitHub workflow triggering staging deployment after a release was created (from main); - I have a manual GitHub workflow that deploys the release to production....

Importing Prisma

In a file I created, I have the following code. Initially, I imported "prisma" everywhere I needed it. However, I discovered that this approach creates a global variable, allowing me to use "prisma" in other files without importing it explicitly. I'm unsure if this is acceptable or if I should continue importing it to avoid potential issues with using the same instance or other concerns (using next 12) ```...

Tailwind Theming using CSS variables

Hey all, using shadcn for styling and they use the css variables like so, recommended by tailwind. https://tailwindcss.com/docs/customizing-colors#using-css-variables ```css...