ahkhanjani
TTCTheo's Typesafe Cult
•Created by ahkhanjani on 4/16/2024 in #questions
Drizzle + SQLite updated at field
Is the only way to have an updated at field in SQLite just setting the updated at by hand on each update? And if so what is the best solution for it in Drizzle? Can you just set as a value?
1 replies
TTCTheo's Typesafe Cult
•Created by ahkhanjani on 3/26/2024 in #questions
Use tRPC in a package in monorepo
Sspecifically with
create-t3-turbo
, how would one use a tRPC client call inside a package? Since the helpers are placed inside the apps, with their own ports.1 replies
TTCTheo's Typesafe Cult
•Created by ahkhanjani on 3/16/2024 in #questions
Force Vercel build to fail when GitHub action fails
I've come to realize that create-t3-turbo's action won't do that. This means a type error can still build successfully. Am I mistaken? How can we achieve this?
13 replies
TTCTheo's Typesafe Cult
•Created by ahkhanjani on 3/15/2024 in #questions
Trouble setting up Prisma with Turbo CI/CD
Using create-t3-turbo, how should I change the current implementation to correctly typecheck and lint on gh actions? I can't get prisma to generate correctly before typecheck and lint, and db:generate always runs in parallel with other tasks even though I've set the dependency in
turbo.json
. Everything works inside the IDE but runs fail in terminal4 replies
TTCTheo's Typesafe Cult
•Created by ahkhanjani on 3/10/2024 in #questions
Nitro, Next Auth and Google callback URL
How to setup create-t3-turbo's auth proxy with Google OAuth? I can't get it to work and I think it's because of the callback URLs set in Google Cloud console.
11 replies
TTCTheo's Typesafe Cult
•Created by ahkhanjani on 3/7/2024 in #questions
uploadthing: What happens when file name already exists?
What happens when you upload a file with a name that's been uploaded before?
3 replies
TTCTheo's Typesafe Cult
•Created by ahkhanjani on 2/26/2024 in #questions
Next-auth v5 config file server code leaks into client components
I'm upgrading a Next 12 pages router codebase into app router incrementally. So I have to use
<SessionProvider>
and useSession()
for some parts to work. I made those work by upgrading next-auth
to v5. But that created another problem.
Previously, things like singIn()
and signOut()
were part of the next-auth/react
package; but now they're returned and exported from calling NextAuth()
.
Inside my auth.ts
which I used some boilerplate from create-t3-turbo
to upgrade, I have some server code. Things like googleapis
, db
and env
. Apparently just because these are imported in the file, using signIn()
exposes them to the client bundle and I get errors such as Module not found: Can't resolve 'fs'
, or on the client: Error: :x: Attempted to access a server-side environment variable on the client
.
Thanks in advance ♥️
packages: next 14 canary.51, next-auth 5 beta.13, trpc 112 replies
TTCTheo's Typesafe Cult
•Created by ahkhanjani on 6/24/2023 in #questions
Prisma client extensions in T3 app
T3 app uses this variable called
globalThis
and globalForPrisma
. I don't understand the usage of it, but it nullifies the extended types. Can I just remove these and use new PrismaClient()
? If not, what else can I do?
- The file in question: src/server/db.ts
- The page for client extensions: https://www.prisma.io/docs/concepts/components/prisma-client/client-extensions/result20 replies
TTCTheo's Typesafe Cult
•Created by ahkhanjani on 5/25/2023 in #questions
Implement pagination on the server
I'm currently setting a URL parameter with the value of the current page number. I fetch the items by page number on page.tsx and pass them to my client table component. Is this the best way to do this?
More details:
I'm using Prisma
Here's and example of what I'm doing:
Is the navigation correct? I'm not sure how to prevent people from changing the URL param and go to pages that don't exist. At least I'm looking for the current best practice.
This would be unnecessary if I could use tRPC in /app. If there's a workaround with that I would appreciate it.
5 replies
TTCTheo's Typesafe Cult
•Created by ahkhanjani on 5/21/2023 in #questions
What UI design library do Clerk and uploadthing use?
The dashboards in both look identical. Is it a library?
4 replies
TTCTheo's Typesafe Cult
•Created by ahkhanjani on 5/4/2023 in #questions
Clerk: Getting the OAuth access and/or refresh token of user
The title should say it all. Does Clerk's user interface even include the two?
7 replies
TTCTheo's Typesafe Cult
•Created by ahkhanjani on 3/24/2023 in #questions
Why use Turborepo over Nx
In general or/and for Next.js specifically. I've seen Theo talk about Turbo but when I tried it, it was painful because of all the ESLint errors in the default repo it created. Nx is way richer in tools and benchmarks show that it's faster than Turbo, although I'm not sure if that's still the case. What benefits Turbo has other than being simpler for smaller projects?
16 replies
TTCTheo's Typesafe Cult
•Created by ahkhanjani on 3/22/2023 in #questions
Astro Zod environment variable validation
How can I implement the same pattern T3 app uses in env.mjs uses in Astro?
6 replies
TTCTheo's Typesafe Cult
•Created by ahkhanjani on 3/19/2023 in #questions
A Complex Union Type
How to get this union type:
From this object:
This is the best I could do:
But it will combine both x and y with a..g
4 replies