Theo's Typesafe Cult

TTC

Theo's Typesafe Cult

Join the community to ask questions about Theo's Typesafe Cult and get answers from other members.

Join

t3 getServerSideProps returns

After adding ```ts export async function getServerSideProps( context: GetServerSidePropsContext ): Promise<GetServerSidePropsResult<{ session: Session | null }>> {...

Astro Not Working on Vercel

I got an astro app with some react components. Dev server works fine and so is the build. When I deploy it to vercel I get code 500 error. Idk what I'm missing. This is my astro config file ```import { defineConfig } from "astro/config"; import tailwind from "@astrojs/tailwind"; import react from "@astrojs/react"; import image from "@astrojs/image";...

Planetscale + Prisma Connection Pool Limits

Does anyone understand connection pool limits? I'm a noob and am running into this issue:
Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 17)
Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 17)
Is it as simple as adding a custom connection limit in the database connection URL?...

Prisma error in production only

My prisma keeps saying sporadically that it cannot connect to the db, other times it has no problem with accessing the db, super confused

Video hosting solutions

I have a couple videos on a site I'm building and I'm trying to figure out what the best video hosting options are these days. Trying to avoid manually transcoding to all formats, and save bandwidth vs hosting on Vercel. What is everyone's favorite? Or maybe an all in one transcoding solution and I just host it in an s3 bucket?

Weird Question For People Who Have Some Experience With React Spring

I am working on a app where I am trying to add a parallax effect to the landing page. I am running into a bug however where there is a large gap between parallax layers where the speed is > 0 and the offset is 1. I am able to sort of get around this by setting the offset to almost 1 (eg: 0.99999) but this still leads to a bug where there is a large gap at the bottom of the page. Here is a piece of code that leads to the issue where there is a large gap between the blue and red layer: ```ts...

Prisma migrate returns error for a field that was already removed

Hi, i'm using prisma with cokroachDB and I made a few changes to my schema and tried to migrate, but prisma returns an error that mentions a field that doesn't exist (it did exist in former migration). It seems to not realize that I've changed the schema. Can I delete all past migrations? maybe it'll help...

Vercel takes ages to ISR from Sanity

My NextJS app deployed on Sanity has some data in the footer that's common on all pages. The footer data can be updated from Sanity incrementally. I have revalidate: 10 set inside the getStaticProps however it takes more or less 10 years for the data to update on the footer after I change it in Sanity. Anyone got an idea what the issue could be? I don't think it's being cached in the browser locally because I've tried it on other devices + incognito + clear storage. Thanks!...

React SVGR in t3 app?

Does someone know why I can't setup https://react-svgr.com/docs/next/ in my t3 app? This is my config file: ```ts...

ESLint not recognizing node_modules when mounted to parent dir, VSCode

getting Parsing error: Cannot read file '/home/projects/dir_name/tsconfig.json'.eslint I'm assuming this is because its looking for the tsconfig at projects/dir_name when in reality the project is projects/dir_name/client. Not sure how to best address this...

Multiple nextjst apps mono repo

Does it make sense to have 3 nextjs repos with t3 apps/... blog-site marketing-site...

I still have hmr.js when I do `pnpm build` in an Astro project???

how do I generate a production optimised build in Astro?

Typescript - Fix for ParsedURLQuery, is this dumb?

Following along with https://create.t3.gg/en/usage/trpc I was making a route to query and getting this error over and over. It kept telling me to make it a string, My solution?
const userQuery = trpc.server.getUniqueServer.useQuery(`${query.pid}`);
const userQuery = trpc.server.getUniqueServer.useQuery(`${query.pid}`);
...

mono repo with multiple next.js apps sharing one nextjs api example?

Does anyone have an example of a mono repo, one app with the t3 stack, another with nextron?
Currently: apps/nextron ...

next-auth says no V8???

I'm using next-auth with next 12 and I get this error. Has anyone ever encountered it? My next libraries' versions are:...

Prisma TRPC Postgres Question - Should I have 1 large Model or smaller tables and query them all?

I don't find an obvious 'best practice' for how to layout a database design for 20-50 column databases, should you limit the column size and query more tables or have larger tables to have a single query point?

SyntaxError Cannot use import statement outside a module

Hi! I've just starter using react-sigma to render a graph on my T3 app. At first everything was working as expected until suddenly the app refuses to compile anymore, giving the attached error. From googling some, I suspect the error has something to do with SSR so I'm wondering how to handle that? Break the code out into a component using a dynamic reload? Is that the way to go?...

What's the exact definition of Serverless

I was never 100% sure what exactly Serverless term means.Is it not using our own dedicated server for our app? Or using a full stack framework like next js which comes with its own node server? Or using a firebase kind of thing which exposes their own APIs ? I just want to have a clear understanding of it. Could anyone give me some clear picture of it

client.mjs, server.mjs, process.env

Can someone please explain the use cases for each? I see that process.env in used in src/utils/trpc.ts. Why not use server.mjs there? In server,mjs we do ...clientEnv which means in server.mjs we have all the env variables. Then when should we use client.mjs?

Env variable (I have read the t3 docs and it's still unclear to me)

I'm using import { env } from "../../../env/server.mjs"; for server environment variables. Should I use import { env } from "../../../env/client.mjs"; or process.env.NEXT_PUBLIC_MY_CLIENT_ENV_VAR for client side env variables? And why is it that in server.mjs we export the client side env data? export const env = { ..._serverEnv.data, ...clientEnv };...