FluX
Explore posts from serversTTCTheo's Typesafe Cult
•Created by Jakov on 3/22/2025 in #questions
Buying domain
Haven't used Render, but with Vercel it's very easy to connect a domain to your project. You'll just have to add one or two DNS records to your domain via the Namecheap dashboard.
I use the Zoho Mail free plan. You can connect one custom domain and create up to 5 users.
5 replies
Type error when following guide TRPC React query: 'lazy' is declared here.
Make sure your server and client are using the exact same version of trpc. That should usually fix errors like this one. (If your versions are already in sync, I unfortunately have no clue what's wrong)
4 replies
TTCTheo's Typesafe Cult
•Created by Hex on 3/11/2025 in #questions
Google Docs Clone Tech Stack
In my opinion you don't need to learn another language if you know TypeScript/JS. I'd rather get really good at one language than mediocre at 3 different languages (short-term) (not counting HTML/CSS).
Plus with TS/JS it's nice that you can build both frontend and backend with it. Some people might argue that you should use a "dedicated" language for backend stuff, but from my experience you can build solid apps with TS. Plus the ecosystem is huge - there's a package for everything.
If you want to land a job, I think the requirements also depend on your country. For example here in Germany, PHP is very popular and many medium-sized companies use it for backends.
But as I said, in my opinion TypeScript is a solid choice which can get you a variety of jobs from frontend to backend. If you're decently good at designing / HTML / CSS that's a huge plus.
I highly suggest that you build some kind of portfolio using the tech you know - Svelte and TS - and make it open source. That's a nice way to showcase your skills.
If you know the principles of any frontend framework, I think one can also land a job at a company which uses a different framework. Because Svelte, React, Vue, etc are very similar, the learning curve should be quite steep.
7 replies
TTCTheo's Typesafe Cult
•Created by vikram960 on 3/9/2025 in #questions
which SaaS is used to make this https://docs.uploadthing.com/
Both docs seem to be using a Next.js + Tailwind template https://tailwindcss.com/plus/templates/protocol
4 replies
File based structuring, trpc layout
That's not possible as far as I'm aware. You always need to define the structure of your router in code.
One approach that comes close to what you're asking is to create nested routers and organize routers and procedures like so:
You'll still need to add your procedures to your routers in code
3 replies
I'm trying to get type for queries/mutations returned from trpc use hooks, but they are different
This is how I did it:
And here is the same for the new
tanstack-react-query
integration:
You should be able to build types for useMutation
the same way. I have no examples for that7 replies
TTCTheo's Typesafe Cult
•Created by AmohPrince on 2/27/2025 in #questions
Where the hell do you guys buy your domains
I've been using Namecheap for a few years and been very happy with it. They have great filters for finding TLDs by topic. But in the end I'd say it's mostly personal preference
13 replies
TTCTheo's Typesafe Cult
•Created by plyglt on 2/25/2025 in #questions
How do I prefetch trpc serverside and then hydrate the client?
You are probably looking for this https://trpc.io/docs/client/react/server-components
4 replies
Where did useUtils go?
useUtils
is just a wrapper around Tanstack Query. See https://trpc.io/docs/client/react/useUtils#helpers
The new integration uses native Tanstack Query, removing the wrappers. For your case (the fetch call) I believe you must change your code to:
8 replies
correct way to handle errors run time errors
You could try the approach I posted here a few days ago:
https://discord.com/channels/867764511159091230/1337500157398355968/1337508102316232754
7 replies
TTCTheo's Typesafe Cult
•Created by MrMasolov on 2/15/2025 in #questions
Fetch data in Next app to be available across all app
More info here:
https://react.dev/learn/passing-data-deeply-with-context
https://react.dev/reference/react/createContext
3 replies
TTCTheo's Typesafe Cult
•Created by MrMasolov on 2/15/2025 in #questions
Fetch data in Next app to be available across all app
I would create a React context and place it in the root layout, wrapping the rest of your app.
E.g. if you need the current user information, create a UserProvider
... and then just place it in your root layout.
You can then use
const { user } = useUser()
in any client component.3 replies
Can't build NextJS with TRPC vanilla client.
I've had similar issues before and it has to do with path aliases in the tsconfig.
I think what's happening is that nextjs tries to resolve
@/collections
inside of the client
app folder and not inside the server
folder.
Unfortunately I don't have a solution for you, since I work around that by avoiding aliases in my trpc routers, though I agree using path aliases is way cleaner for imports.4 replies
error handling
I guess what you're referring to is the little error popup in Next.js.
What I like to do is to wrap my mutation call in a try/catch wrapper function and show a toast in case of errors.
Not sure if this is the best solution but it works.
9 replies
How to reset the cache without triggering refetches for none active queries ?
A quick search brings up this:
https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientclear
4 replies