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

Help, how do I do this?

Each user has multiple workspaces. However, a user can only be using one workspace at a time (active workspaceId)

User authentication in Astro?

What ways are there to do user authentication within Astro, similar to NextAuth? I have found a package (Astro-Auth) that seems similar, but also seems like it hasn't been worked on for a while and the docs appear to be a little scattered. The goal was to do something similar to Auth.js's Email provider with the magic email links to sign people in. Does any information exist on doing something like that in Astro?

get rid of Symbol iterator in autocomplete

Hi TS nerds, I'm in dire need of help; For a bit of context, I have a function that returns a tuple: const [hej, do] = myFunc(), and I'm looking to allow an object being returned by the same function: const obj = myFunc() // obj.hej and obj.do exist. for WAY more accurate code, see: https://github.com/bdsqqq/try/pull/10 My solution of choice rn would be: ...

JavaScript alternative to CanCanCan

Does anyone have any recommendations for a JS library that manages authorization and permission to resources? We use CanCanCan in our Rails app and are looking for a JS alternative in a new app that manages 4 different types of users/subscriptions.

How do I type T3 App with nestable layouts for each route?

I am new to Create T3 App and I want to be able to have 1 T3 app that handles both a public users and (admin users through /admin route only). The public user site should have its own seperate navbar/layout compared to the /admin site. I would rather use the app directory for nested layouts in Next13 however, it is still in beta or experimental and I don't want it to break next auth and anything else, since others seem to be having problems with. it.
I have had a look at this article: https://adamwathan.me/2019/10/17/persistent-layout-patterns-in-nextjs/ and it seems to be able to do everything I need. ...

nextjs API routes become unresponsive in dev mode

I am encountering a problem where the API routes become completely unresponsive in dev mode. To demonstrate this, I have created this minimal example. https://github.com/amit13k/create-t3-app-example2 ...

Nextjs with CSS in JS

I am using ant design (https://ant.design) on a Nextjs project (pages folder). The component styles don't seem to be SSRd, there is a flash of unstyled content when the page is first loaded. Ant design docs have some instructions on how to do SSR - https://ant.design/docs/react/customize-theme#server-side-render-ssr But I can't figure out how these apply to Nextjs....

[next-auth] Updating user model with new values after oauth signin

Maybe someone can give some pointers on this Let's say we have this flow 1. User tries to access an protected route 2. Is redirected to /login with an callbackUrl for the protected route and isSubmitting url query...

docker lags my pc

Heyy I've wanted to try Docker since it's something many people mention, but after installing Docker Desktop when I launch it, it makes my PC lag really bad. I'm on windows 10 and have 8gb RAM, it's not much but I didn't expect it to make it unusable. Anyone know something about this?

Dynamic subdomains

Hi, I would like to setup custom subdomain to act like a slug, something like: [slug].mysite.com. I thought of using nginx that reverse proxy that will swap the subdomain to the slug in the background. So something like this: subdomain.mysite.com/hello -> mysite.com/subdomain/hello....

VR dev setup

Anyone here write code in VR? This blog got me really interested on trying it out: https://medium.com/immersedteam/working-from-orbit-39bf95a6d385

EAS Build Failing without error

hey guys, i have updated to expo 48, and run npx expo-doctor amd npx expo install --fix however it seems to not build past this point.... The last version i used was expo sdk 46, and builds were working...

Help debugging crash only on mobile browsers

If you go to my site https://truefinals.com/tournament/0d4329c50c1b3535 and use the pinch / zoom feature the site crashes. Simply zoom out a little and wiggle your finger around and youll see the page drops frames (which im ok with given how heavy this animation is) before it eventually crashes. I cant seem to get any info on what is causing the actual crash. IDoes anyone have any tips on how to find out where the crash is coming from?...

has anyone successfully setup t3 with jest + rtl?

I'm getting a Error: Uncaught [TypeError: Cannot read properties of undefined (reading 'trpcState')] error when I try to setup my next page component.

VSCode wrap with function call snippet/shortcut? Or move cursor to beginning of selection?

Hey all trying to wrap a long array of objects in a function call.. I looked at the 'surround' snippet in VSCode but the only function wrapper they have is to actually declare one, not simply call... Any ideas? Id be happy to do it with selections, but you cant move your cursor to the beginning of a selection (only to the beginning of a line). :~(

MDX Intellisense

Hey, I ran into this when updating the create-t3 docs and now when creating my own docs . Take this screenshot for example, when I bring up auto complete it should show me what props this component needs and yet nothing appears, anyone know of an extension to get this? Thanks!

How to load a build index.js file that requires other modules

I am trying to make a plugin system for my app. Screenshot is the code loading the plugin. The index.js containing the plugin sits in a separate plugins folder (alone). When I try to run require() I get an error that the dependency of my plugin api has not been found(module not found error).

Tailwind breaks on hot-reload

Tech: Tailwind latest version, next.js 12 I realized that my tailwind breaks (aka some classes suddenly have no effect) on hot-reload, and specifically when I shut down my local server, and run it up again. When I have my localhost opened on the browser,...

Next Image

so my css is breaking on the first load if i use the priority in the <Image> ```{shopImg && ( <Image src={shopImg} alt="My Image"...

Deploy Strategy

What do you guys use for your deployment strategy? I bought a virtual private server and I'm trying to figure out the best way to deploy.. I'm leaning towards docker and GitHub actions with nginx