shikishikichangchang
shikishikichangchang
Explore posts from servers
TTCTheo's Typesafe Cult
Created by shikishikichangchang on 4/10/2024 in #questions
trpc/react not working on AWS
No description
28 replies
TTCTheo's Typesafe Cult
Created by shikishikichangchang on 3/29/2024 in #questions
keep previous data
the latest t3 app doesn't support keepPreviousData in useQuery? App router, drizzlem, trpc setup.
2 replies
TTCTheo's Typesafe Cult
Created by shikishikichangchang on 3/23/2024 in #questions
trpc query failing in prod
I'm using trpc's use query together with nextjs 14's server components. The useQuery is in a client component. Everything works perfectly locally, including the productino build. However when I deploy to AWS via sst, it starts failing. Any idea why? This is the error: SyntaxError: Unexpected non-whitespace character after JSON at position 2. It shows up in the browser console through loggerLink. When I inspect on the network tab, it does return the response with the right data. It seems like trpc on the front end isn't able to pass the right stuff to reavt to re-render? Upon checking the response in detail, I see that there's "62 bf" and "0" at the beginning and the end of the json response respectively. This only happens in the deployed version. Not even on the locla built version.
18 replies
TTCTheo's Typesafe Cult
Created by shikishikichangchang on 3/23/2024 in #questions
retry logic with server action
How do you implement retry logic with server action? I'm using next-safe-action if that matters.
3 replies
TTCTheo's Typesafe Cult
Created by shikishikichangchang on 3/8/2024 in #questions
nextAuth v5
Has anyone been able to make it work? Tried it and keep getting Error [ERR_MODULE_NOT_FOUND]: Cannot find module
3 replies
TTCTheo's Typesafe Cult
Created by shikishikichangchang on 2/23/2024 in #questions
Weird cache behavior
I created a new t3 app with app router and trpc. Then I moved CrudShowCase (including the get posts part) to a new route. I realized a weird behavior after adding artificial delay to the get posts api. 1. On initial visit - fetch data from source and takes a while 2. On subsequent visits < 30s: instant page load due to cache 3. On first visit after 30s - fetch data from source and takes a while 4. All visits from here on - fetch data from source and takes a while. The discrepancy/unexpected outcome is 4. I thought 4 should be the same as 2, in that the cache is reset to the 30s timer and the user would get instant page loads again. But that is not the case. Can someone confirm this is expected or non-expected behavior?
15 replies
TTCTheo's Typesafe Cult
Created by shikishikichangchang on 2/4/2024 in #questions
sensitive file
Is it safe to store a sensitive file in the src (not under "public") directory? Can't seem to find any docs on this. Basically I need that file when a function runs so I run this code: fs.readFileSync(path.join(process.cwd(), "", "sensitiveFile.text"));
6 replies
TTCTheo's Typesafe Cult
Created by shikishikichangchang on 11/7/2023 in #questions
benefits of server actions?
What are the pros and cons of using server actions versus trpc mutation? I think they both have to send a POST request to their server either way?
2 replies
TTCTheo's Typesafe Cult
Created by shikishikichangchang on 11/7/2023 in #questions
shadcn - can only use it in server components?
Tsia
2 replies
TTCTheo's Typesafe Cult
Created by shikishikichangchang on 11/7/2023 in #questions
how to revalidate data?
Router.refresh() purges all the caches if I understand correctly. How would you invalidate a cache after running a mutation using trpc on a client component?
200 replies
TTCTheo's Typesafe Cult
Created by shikishikichangchang on 11/6/2023 in #questions
trpc in server components
Has anyone been able to use trpc to access the db in a server component? I’m able to access it using the db directly, but it fails if I use trpc/server. Note: build && start works fine locally. But it fails when deployed to Vercel.
1 replies
TTCTheo's Typesafe Cult
Created by shikishikichangchang on 11/6/2023 in #questions
TRPC fails to work on server components in Vercel environment
No description
20 replies
TTCTheo's Typesafe Cult
Created by shikishikichangchang on 11/2/2023 in #questions
Clerk and T3 (app router)
Does clerk work with T3 app router yet
5 replies
TTCTheo's Typesafe Cult
Created by shikishikichangchang on 11/1/2023 in #questions
Security in Next 14 and T3
Can someone recommend some best practices for securing secretes? I've read online about using a: 1. Data access layer 2. "server-only" Should I be slapping a "server-only" on every server related function? Do I need to do that for server actions since they already have "use server"?
2 replies
TTCTheo's Typesafe Cult
Created by shikishikichangchang on 10/28/2023 in #questions
Nice images
No description
6 replies
TTCTheo's Typesafe Cult
Created by shikishikichangchang on 10/21/2023 in #questions
trpc/react vs trpc/server
Can someone explain what the differences and when to use which? I just watched this https://youtu.be/PmBfq-SpzCU and am a little confused on that part. 1. What are the pros and cons of each? 2. Should I always use trpc/server for Server Components and trpc/react for Client Components? 2. What role does trpc/server play on Server Components when I can directly use db.query..posts.findMany()?
2 replies
TTCTheo's Typesafe Cult
Created by shikishikichangchang on 7/26/2023 in #questions
prisma data browser
What are some alternatives to prisma data browser? Essentially prisma studio, but on the internet (not local).
2 replies
TTCTheo's Typesafe Cult
Created by shikishikichangchang on 6/19/2023 in #questions
replace [projectId] with project name
Currently my url looks like this: http://localhost:3000/projects/asdjkfb67284v. How can I replace ithe id "asdjkfb67284v" with a unique project name? For example, I want something like http://localhost:3000/projects/my-new-project.
7 replies
TTCTheo's Typesafe Cult
Created by shikishikichangchang on 6/17/2023 in #questions
Shadcn ui drop down menu
19 replies