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

NextAuth: Cannot login with CredentialsProvider

I'm currently developing my web app using the full-featured t3 app, and I don't want to connect to the real provider while developing. (Since there are roles and it's much better if I can switch my role during development directly on my UI) According to the answer of the following GitHub issue and a side note from t3-app docs, I added a credential provider in the authOptions object inside src/api/auth/[...nextauth].ts with some hardcoded users. https://github.com/nextauthjs/next-auth/issues/5587...

Hydration failed because the initial UI does not match what was rendered on the server

This only happens when I try to put a <figure> element inside of a paragraph, nextjs

How do you run `primsa` commands in a `create-t3-turbo` monorepo?

I can run pnpm db-push but I would like to run other commands, like prisma migrate. I can't figure out how to do this

Ternary statements with possible null/undefined

I am working with an object with the following shape:
{ image: string, previewImg: number }
{ image: string, previewImg: number }
images is just a string with UUIDs separated by commas. If the UUID is for a video they are prefixed with "video-". ...

Random webdev question

Is there a css property to update the arrow colour on a select component?

When will the react Component remount?

I hear React itself use Object.is to decide whether to reRender a component or not How about remounted? What does React check? I give Object.is a try in the link, but it ends up "not this" ...

i require assistance from the typesafe cult (solved)

type the keys on a const object while preserving their assigned values. ```ts const FileNamesMap: {[key: string]: string[]} = { 'Activity': [...

Help! using listbox headless ui

i code like this and it show me this error, anyidea how?

How to preload conditionally rendered next/image

In my app i have slideshow/presentation thing where images appear in full-screen one after another. I achieve that using conditional rendering (show different images based on a state). The problem is that when the slide is shown for the first time, image starts loading and worsens the experience. How could i preload all the images at once? I've already tried adding next/head with <link rel="preload" as="image" type="image/png" /> for all the required images, but it doesn't seem to help....

How to use the accessToken to call a route that is protected by nextauth from server ?

Does any one have examples where you use accessTokens to autenticate API call instead of cookies and sessions.

Best way to AB Test on T3 Stack?

What's the best way you've found to run A/B tests? Assuming you're deploying on vercel?

Override ENV variables inside Docker Compose

Hey, I have those ENV variables for my docker compose config. There's one problem, inside docker I have to specific DB_HOST {container_name}, so I've tried to override it. ```yaml DB_HOST=localhost...

New NodeError (looping error)

I sometimes get this error over and over again in a loop, and can't figure out what's causing it. Anyone else seen this? ``` at new NodeError (node:internal/errors:393:5) at Function.fail (node:internal/assert:20:9)...

trpc query only once parameter is not null

New in T3 stack so forgive me if this is a noob question: I am trying to run a trpc query only if a user is logged in. The user id is part of the query parameter. const { data: sessionData } = useSession();...

React Table getting weird key error

Hey guys, using react table in my current project. I was getting linting errors on Vercel for not having a key on my .maps inside of the table, so I tried adding them, however im getting some strange errors that I haven't really been able to understand whats going on. I have a code snippet of my head below, and screenshot of the error I am receiving . "'key' is specified more than once, so this usage will be overwritten." Any ideas on whats going on here? ...

Unsafe return of any typed value, using prisma upsert

Hi all; I'm getting a lot of warnings in my IDE in this code; `...

How to make the NextAuth custom signin page typesafe?

Hi all! I am trying to make the custom signin page described here: https://next-auth.js.org/configuration/pages In a typesafe way, but I only get it worked with suppressing a lot of eslint warnings, which I don't want to do. Does anyone has an example of how to do this in the proper way? The errors I get are:...

Complicated recursive types for self-relations in prisma models...

Prisma documentation says that types only contain the model's scalar fields, but doesn't account for any relations, thus you must use GetPayload. Prisma Model: ```model Category { id String @id @default(cuid())...

Next Auth + Next13 error

Error: [next-auth]: useSession must be wrapped in a <SessionProvider /> I get this error in the console when I want to wrap myApp component. I'm using Nexta13 and I'm not entirely sure if my folders are well organized. Maybe the error is due to this? Could you take a peek? ...

Refetch minimum duration?

I wish to always keep data up to date and I use ```json { refetchOnMount: true, refetchOnWindowFocus: true,...