lanc3
lanc3
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Mohit on 10/25/2024 in #questions
Facing issue when adding graphql to nextjs
You must create a custom component that wraps the apollo provider with "use client" at the top
3 replies
TTCTheo's Typesafe Cult
Created by Peter on 9/13/2024 in #questions
PlanetScale vs. AWS
Might prefer neon for postgres otherwise dynamodb is a bit cheaper than both AFAIK though not as nice to use as either
8 replies
TTCTheo's Typesafe Cult
Created by Y7YA on 8/11/2024 in #questions
Server actions in server components
No description
6 replies
TTCTheo's Typesafe Cult
Created by Backurdi🙌 on 8/21/2024 in #questions
What’s the best way to host my Next.js project if I need to have a static IP address?
I'd also check out https://www.flightcontrol.dev/, it's basically an abstraction on top of AWS that provides an experince like Railway
7 replies
TTCTheo's Typesafe Cult
Created by Jeremy on 8/7/2024 in #questions
Session not complete on expo but it is on NextJS
Would probably need the nextjs logs, signing out on t3 turbo does it in a unique way compared to the web with a specific tRPC procedure signOut https://github.com/t3-oss/create-t3-turbo/blob/main/packages/api/src/router/auth.ts
5 replies
TTCTheo's Typesafe Cult
Created by antoni on 7/14/2024 in #questions
[t3-turbo]: Redirect does not work in app
You need to redirect to your app after successful login, it does not know when to close the browser. If you're using expo https://docs.expo.dev/guides/linking/#linking-to-your-app
3 replies
TTCTheo's Typesafe Cult
Created by rdickert on 6/27/2024 in #questions
Using nextauth discord with vercel deployments
You create a proxy auth service like t3-turbo does. It basically just serves a static URI for your preview environments. I don't remember the exact logic, but you can just reference t3 turbo
8 replies
TTCTheo's Typesafe Cult
Created by bythewayitsjosh on 6/23/2024 in #questions
trpc with Server Actions
If you're going to use server actions, that is what I would do. Server actions are not great for querying, unless you want to do a lot of route invalidation which might not be performant, but they do make certain data mutations a lot easier. Boiler plate of tRPC and generic API handlers to change a field or two is very annoying, but server actions handle that easily no issues Tanstack query is also just great tooling for queries and you can't use that with server components / server actions
6 replies
TTCTheo's Typesafe Cult
Created by Ibnu Rasikh - creatypestudio.co on 6/4/2024 in #questions
Have you experienced your Next.js getting hacked?
Getting "hacked" in the traditional sense is basically non-existent in non-self hosted sites. Often WordPress users are non-technical and malware can easily be disguised in plugins and themes. This is also an issue for npm libraries but much less prevalent. You can definetly get hacked though for self-hosted solutions of wordpress and next.js, but that's regardless of the framework
4 replies
DTDrizzle Team
Created by ethan! on 5/27/2024 in #help
Enums
otherwise drizzle will not pick it up
9 replies
DTDrizzle Team
Created by ethan! on 5/27/2024 in #help
Enums
You probably need to export that enum
9 replies
TTCTheo's Typesafe Cult
Created by gwilliamnn on 10/24/2023 in #questions
How can I use a localStorage persister?
really depends though on how your application works
9 replies
TTCTheo's Typesafe Cult
Created by gwilliamnn on 10/24/2023 in #questions
How can I use a localStorage persister?
You'll have to do something like this
const localStorage = typeof window !== "undefined" ? window.localStorage : null;
const localStorage = typeof window !== "undefined" ? window.localStorage : null;
9 replies
TTCTheo's Typesafe Cult
Created by migs on 1/31/2024 in #questions
TRPC Security/ Authorization Concerns
This is fine to do depending on how you do it. I've found the easiest primitive way is to just have an ownerId column on DB resources and check if the session user id is equal to the ownerId
13 replies
TTCTheo's Typesafe Cult
Created by migs on 1/31/2024 in #questions
TRPC Security/ Authorization Concerns
T3 stacks provides authentication functionality for TRPC, i.e. protectedProcedure but does not handle authorization as that is a complex problem to generically solve. The simplest thing you could do is check if the user owns that particular resource by using DB queries. There are also some libraries like https://github.com/stalniy/casl which provide a much more thorough layer of authorization
13 replies
DTDrizzle Team
Created by Michael Schaufelberger on 5/12/2023 in #help
MySQL (Planetscale): Cannot read properties of undefined (reading 'name')
Just a small bump on this since I also encountered this issue and was confused for a while for the same reasons as OP. This seems to be a typescript issue? I.e. in my case this gives no error
await db
.update(workflows)
.set(input) // Drizzle zod schema validated but with relations (which was my issue). No type errors.
.where(eq(workflows.id, input.id));
await db
.update(workflows)
.set(input) // Drizzle zod schema validated but with relations (which was my issue). No type errors.
.where(eq(workflows.id, input.id));
but the following gives the correct type error
const {relation1, relation2, ...rest} = input;
await db
.update(workflows)
.set({relation1, relation2, ...rest}) // Error: Object literal may only specify known properties, and relation1 does not exist in type
.where(eq(workflows.id, rest.id));
const {relation1, relation2, ...rest} = input;
await db
.update(workflows)
.set({relation1, relation2, ...rest}) // Error: Object literal may only specify known properties, and relation1 does not exist in type
.where(eq(workflows.id, rest.id));
and removing the relation fields fixes both the type error and the error from drizzle. Perhaps then the best solution is to handle this error and throw a descriptive error from drizzle
34 replies
TTCTheo's Typesafe Cult
Created by Aditya Kirad on 12/23/2023 in #questions
Loading UI not showing
14 replies