Vengeance
Vengeance
Explore posts from servers
TtRPC
Created by Vengeance on 5/27/2024 in #❓-help
Send File Back From Procedure
Is there a way to send content like this back from a tRPC procedure?
const headers = {
"Content-Type": "application/vnd.apple.pkpass",
"Content-Disposition": `attachment; filename=${passFilename}`,
"Content-Length": passBuffer.length.toString(),
};

return new Response(passBuffer, { headers });
const headers = {
"Content-Type": "application/vnd.apple.pkpass",
"Content-Disposition": `attachment; filename=${passFilename}`,
"Content-Length": passBuffer.length.toString(),
};

return new Response(passBuffer, { headers });
3 replies
TTCTheo's Typesafe Cult
Created by Vengeance on 4/22/2024 in #questions
create-t3-app next auth question
In the default auth settings for t3, I noticed id: token.sub in the callbacks making the id available on the user object. Is this sub something I can use as my unique user/account id in my db? What is sub?
export const authOptions: NextAuthOptions = {
callbacks: {
session: ({ session, token }) => ({
...session,
user: {
...session.user,
id: token.sub,
},
}),
},
export const authOptions: NextAuthOptions = {
callbacks: {
session: ({ session, token }) => ({
...session,
user: {
...session.user,
id: token.sub,
},
}),
},
9 replies
TtRPC
Created by Vengeance on 4/15/2024 in #❓-help
Don't understand cache
How come my API is still getting called when it's already been called with other inputs? Ex: 1. api fetch with 1 as the input 2. api fetch with 0 as the input I expect if the input gets set to 1 again, the API would not be called because we already fetched the result for that Am I doing something wrong or need to set something up? I'm on v11
4 replies
TTCTheo's Typesafe Cult
Created by Vengeance on 3/20/2024 in #questions
chrome inspector blue all of a sudden
No description
2 replies
TTCTheo's Typesafe Cult
Created by Vengeance on 11/24/2023 in #questions
Go-to Backend Server
I've been doing serverless so much that I don't actually know what the best backend server to host locally is anymore. For one reason or another I have to host a JS server at work for a webservice, does everyone still use express?
7 replies
DTDrizzle Team
Created by Vengeance on 11/10/2023 in #help
Decimal Inferred is a string
No description
4 replies
TtRPC
Created by Vengeance on 11/10/2023 in #❓-help
useQuery in App Router?
I have a client component that I want to use useQuery in like in pages router, but only query is available
8 replies
TtRPC
Created by Vengeance on 10/19/2023 in #❓-help
Vercel maxDuration with tRPC
How do you extend extend tRPC timeouts on Vercel? I tried this in vercel.json:
{
"functions": {
"api/trpc/[trpc].ts": {
"maxDuration": 300
}
}
}
{
"functions": {
"api/trpc/[trpc].ts": {
"maxDuration": 300
}
}
}
3 replies
TTCTheo's Typesafe Cult
Created by Vengeance on 10/19/2023 in #questions
React Native Native Select/Dropdown
No description
2 replies
TTCTheo's Typesafe Cult
Created by Vengeance on 9/28/2023 in #questions
Supabase Auth vs Clerk
Hi, what's the biggest difference between Clerk and Supabase Auth? Supabase is free for 50k MAU, Clerk is a whopping 10 times less, just curious as to why
2 replies
TTCTheo's Typesafe Cult
Created by Vengeance on 9/12/2023 in #questions
Modern Desktop App Framework
Hey guys, I haven't made a desktop app in a really long time, and I was curious what your guys opinions are. Is electron still good these days? Tauri looks interesting
2 replies
TtRPC
Created by Vengeance on 1/30/2023 in #❓-help
tRPC Call To Server
On the mobile version of my app, in NextJS, the build has to be static so I have to use my hosted web version ass the server url, but when it makes requests it says stuff like no query procedure found, whereas in the web version the request works just fine, I think it's because the static version of the app doesn't request with any cookies. How can I solve this?
5 replies
TtRPC
Created by Vengeance on 12/7/2022 in #❓-help
z.map() as an input
Hi, I have
z.map(z.string(), z.string())
z.map(z.string(), z.string())
as an input, but when I try to pass the map as a query, it refuses to run and I have no clue why. Any ideas?
3 replies
TtRPC
Created by Vengeance on 12/6/2022 in #❓-help
tRPC caching vs Vercel dynamic edge caching
What is the difference, or improvements, on Vercel's dynamic edge caching? tRPC server caching works without it. What is the difference? I don't understand
1 replies
TtRPC
Created by Vengeance on 12/5/2022 in #❓-help
Ignore Errors from batch calls
I have some of my routers throw helpful errors for the client to use in the error message object, but when one of those calls in a batch request, it causes the other calls to fail and never resolves. How do you get around that? I'd rather not add a nullable error field to all my results
7 replies
TTCTheo's Typesafe Cult
Created by Vengeance on 11/16/2022 in #questions
tRPC Procedure based cache
Is there a way to set the cache request length depending on the procedure instead of a global amount? I can't seem to figure it out.
10 replies
TTCTheo's Typesafe Cult
Created by Vengeance on 11/1/2022 in #questions
NextJS + tRPC API Logic Question
Are you guys putting your logic for your API routes in separate tRPC router and not making a file in the api directory? Or are you guys defining your API logic in files in the api directory and then also making a router file to define the typesafe inputs/outputs?
6 replies