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

NextJS learning advice

I have been trying to learn NextJS from Udemy for sometime and I feel like I am just listening to a person blabber and I am just copying down whatever is written on the screen. Is there a better way to do this? I am new to NextJS so I don’t know all the concepts yet and can’t start building projects right away. #nextjs

I need to embet a YouTube video in my Expo app. Need to support web too.

Currently I import a library called "react-native-youtube-iframe" to embed YT videos into my iOS/Android app, but it keeps failing when I try to run the app on the web (browser). I tried doing conditional imports, but I can't figure it out. I keep getting the same error about "Unable to resolve module react-native-web-webview from..." I tried setting platform extensions like YoutubePlayer.web.js and such, but that didn't help either. Is there a good solution to this problem? I really want my app to work on the web as well. Thank you!!...

How to best approach coding this carousel

I am having to make a carousel for my work, and I am feeling very stuck on how to implement it. I have tried Swiper, but there are some weird incompatibilities, or shortcomings which I have been pulling my hair out a bit with, I've also tried some of my own implementation but I have been pressured to get this out so I put that to the side and I've been plugging away at some libraries. Has anyone implemented anything similar in the past and has had some success with any libraries?...
No description

Discord oAuth: message: 'State cookie was missing.'

I have this error whenever I redirect my users to my discord login callback URL. I used to have it before error in the console, but it would simply error in the console and display a small message on the UI to the user so I didn't really look further into it, but now, it redirects my users to a 404 page. The error I have in the console is:...
No description

Invalid Signature in uploadthing

Hi - I'm getting an error "Invalid Signature" when I use upload thing with production settings. I can't find any reference to this error anywhere apart from in the code so I'm not sure where to start to resolve this The error in the console looks like this
⨯ UPLOADTHING 1:28:56 PM Invalid signature
⨯ UPLOADTHING 1:28:56 PM Invalid signature
...

can you make REST requests with node on a t3 project?

how does that work can I just also have a node backend or

From 0 to production tutorial help with uploadthing implementation - UploadButton stuck on loading

So I am following Theo's guide to learn nextjs and react a bit, coming from sveltekit, but I am having an issue where the UploadButton component from uploadthing is stuck on loading instead of showing 'choose file' like in theo's video. The button is imported from ~/utils/uploadthing where I have the import code for it and it's not showing me any errors in VScode, but on the server I get this error which I assume is the issue "Warning: Only plain objects can be passed to Client Components from Server Components. URL objects are not supported. <... endpoint=... url={URL}>" ...

[TRPCClientError]: Invalid response or stream interrupted

Hi guys, I made an web app using https://create.t3.gg (holy moly I love this stack) and deployed to Vercel. The deployment works, everything is fine, the page is successfully rendered to the browser, until I recently found out on PageSpeed that my site is returning 500 error. I checked on the Vercel logs and it says there's an error on / path, with message: [TRPCClientError]: Invalid response or stream interrupted. For full error log please take a look on the attached image....
No description

Uploadthing, image is accessible even after deletion?

Hey, I am removing a file from uploadthing, i can see that the file is removed from the bucket but whenever I try to access it using the url, i can still access it. Is there some other thing that i need to do?...

504 Gateway Timeout Error on Vercel

Hello, everyone. I've been really bugged with this error as you've seen above. Anytime I try to host my full stack NextJS application which has MongoDB has it's database, I get that error. Please, how can I fix this?...

props with uploadthing

Hi, I need help with uploadthing, I've been looking for several hours for a way to pass a props (category) and then add this category with the image url in my database, I'm using exactly the basic configuration of the nextjs app router doc.
Solution:
if you set the input in your endpoint following the docs like this : ` import { z } from "zod"; f(["imageEndpoint"])...

redirection not working from root path "/" (react-router v6)

I am using react-router version ^6.25.1 , I want the user to be redirected to the home page /home if he logged in before i am using firebase-auth I check if the user is logged in via onAuthStateChanged observer provided by firebase if there is a user logged the promise is resolved if not it gets reject i am using a loader function to do this check if i call the loader function in my root "/" element the page keeps loading and I am not redirected however if i do that in other pages such as "/Logi...

How to test nextjs app against dockerized postgres container (Vercel)

I have a ct3a deployed to Vercel's free tier. I was wondering if it's possible to spin up a postgres container in Vercel's CI and run some tests before creating deployment previews/etc.

Next Auth Session

I want to use useSession() I want the callback to do a check on the url it is coming from (req.headers.host is ideal); however, I cannot access this information in the callback function. A possible solution I have explored is to go to /api/auth/[...nextauth].ts and override it from there however the problem with this is that whenever I am making trpc requests I have to also manually override that one which makes me repeat unnecessary code. I was just wondering if there is a better way to go about this. The part of the code I am referring to for the callbacks is the following:...

How to add metadata to file been uploaded?

im running app where users can upload files inside each orders, but i want to store the url in my own db, so i have to send order id when uploading so i can get it in my uploadthings route and upload it, i can do this on the after update property of the upload button but would like to know if there is a better way of handling this?

Using Dynamic Routes with Vercel Functions?

Seems like there should be a way to do this... For the route /api/events/init/[key] I have this code: ```typescript import { useParams } from 'next/navigation';...

t3 stack, making querries every time i reload the page?

Hi.. It's the first time when I'm using server components, and, decided to go with this stack. My question is, why do i have in console, a log with querry, everytime i reload the page? is it from the auth, and I was wondering, if shouldn't be a performance concerns.....
No description

How to structure layout.tsx with multiple providers/components you want to render

hello, currently i have a t3 app with trpc and I have multiple layouts clerk, chakra, and trpc. in my main root layout.tsx i also want to render a sidebar. I have tried multiple ways creating a help client-layout.tsx. the issue im getting is a "[cause]: SyntaxError: Unexpected token '<', "<!doctype "... is not valid JSON" in vercel logs im assuming because of how the layouts i have work. also this error only started showing up once i split up the two layouts when i went to integrate my sidebar.

DISCORD OAUTH Problem

OAUTH2, Discord Anyone ever run into this error? https://gist.github.com/barrybtw/8bb94fdcdbbee3d1a24e0e4c2c2f8fea I can run it locally just fine, but whenever I deploy it, I get this error in my logs...?...
Solution:
Figured it out, next takes in NEXTAUTH_URL as environment, defaults to localhost:3000

T3 Env Docker env variables not found

Do you need to use an env file with t3 env, as i am trying to run my next js app in a pipeline using docker. I have the env variable that i want to use in the pipeline enviroment but it is not in an env file. So each time i run it i get an error that the variable cannot be found. Does anyone have any suggestions and i can provide code if helps.
Solution:
there should be a skip check on the env