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

Environment variables in command line script outside

I'm trying to create a simple command line script (ultimately to load my database, but I've not got that far yet). I'm hitting a 'Invalid environment variables' problem.
env-test.ts: import nextEnv from "@next/env";...

hi! Is there a maximum rpm for uploadthing?

I´m trying to undesrtand if there is a maximum request per minute?

debugging live in REPL (Bun)

Hey all, I'm trying to debug some stuff but would like to evaluate and declare variables after the script has finished executing its code. If I use a debugger, it pauses execution so I can't really interact with the environment like I would be able to in say a browser console. Is there a way to do this?...

REST API design error response

Hi, I have a question about API design. When my service receives an invalid POST body, I currently return only an HTTP 400 with no additional content. My reasoning is that normal users always go through my frontend, which already performs client-side validation, so they should never encounter this error. While reviewing other APIs, I noticed that they often return extra information. What do you recommend?...

Does T3.chat support any querystring arguments like /?q=my-prompt ?

I was watching https://www.youtube.com/watch?v=6koQP6-6mtY and saw Theo was able to type a prompt in a new tab field (in Zen) and it submitted it directly to T3.chat, saving a ton of time. I was hoping I could do the same in Chrome by creating a custom search engine in chrome://settings/searchEngines . I figured it might be something like https://beta.t3.chat/?q=sup-nerds but I tried that and the prompt was not entered into the text box. Is this a supported feature or a feature request? (meta: first time poster here. This question seems on-topic for #t3-chat but it was made very clear I should only ask questions in questions so that's why I'm here but there's no t3-chat tag here, hence the Noob tag. Thanks!)...
Solution:
I found it. https://beta.t3.chat/settings/models and then the 'Search URL' button next to any model

Uploadthing onUploadAborted not working?

I was wondering why I got an error when trying to use onUploadAborted inside my useUploadThing hook it says it doesnt exist tried to fix it but couldnt, my uploadthing is also up to date...
Solution:
i had this same issue. you can read below this message to see what conversation took place: https://discord.com/channels/966627436387266600/1102510616326967306/1351067059844546561 the summary is that this onUploadAborted function isn't exposed in the hook. the docs havn't been updated it seems like. you have 2 solutions: ...
No description

Issue with missing-suspense-with-csr-bailout error while upgrading to Next 15

I'm upgrading my project to Next 15, ran the codemod and fix a few errors. Right now I'm stuck with this missing-suspense-with-csr-bailout error where you don't wrap a component that use useSearchParams in a Suspense tag. Previously we used the missingSuspenseWithCSRBailout: false, flag to go pass it in the build but looks like it's no longer working for v15 Anyways I followed the error messages from the vercel dashboard and add a Suspense wrapper on the first client component in the tree but for some reason it's still have the same error on that route and sometimes even errors on other routes that doesn't have that error in previous builds Am I even on the right track? Do I need to find every useSearchParams implementation on every component and custom hooks? Are we living in a simulation? Help please 😭...
No description

Has someone used excalidraw in their next.js project?

If so could you help with a problem that I have with it?
Solution:
Fixed it

T3 Env bundles ALL (even server) envs in build output (Next.js 15)

When using t3 env package in Next.js it seems that it loads everything (partially) into my main-app-[random-hash].js (build output from webpack) The actual value of the server envs are not bundled but the name of the env is. This poses a security risk because now you can see what packages I use on the server to maybe find an exploit. Is this something I'm doing wrong or is it a bug in the package itself?...
Solution:
No description

Passing Cookies / Authentication For QStash

Summery: Adding cookies / authentication in my qstash schedule as the API route is protected Note: Everything works fine locally when i use postman for api testing. QStash does hit the endpoint correctly in prod / testing locally...
Solution:
the solution was using this header
No description

generation

Sorry. New here (but paying for t3). In chatGPT im able to upload an image to give it context / inspiration. Is this not possible currently in the t3.chat app?...

NPM Error when Upgrading from 7.4.1 to 7.7.2 (NextJS14)

Howdy fellow coders. I went to update an app Ive been finalizing for someone, which worked perfectly fine before today as far as building goes - It had said something about the url callback that is now .ufsUrl had been deprecated - still worked though. today I got this type error: Property 'ufsUrl' does not exist on type 'ClientUploadedFileData<{ uploadedBy: string; }>'. when trying to push what wrre supposed to be just UI/information changes, so I tried to update the @uploadthing package to the current recommended version, and theres a broken dependency stream. ...
No description

Expo + Express on the backend | (maybeServerData ?? data)?.find is not a function

I cant seem to get uploadthing working when using express as a backend with expo. There is a lot of documentation when using expo + expo api routes, but when using express, its lacking and also causes an error that i cant seem to resolve ``` Uncaught Error...
No description

Stop t3-env from asking for env in github actions

Title^^ My ci/cd to vercel is failing as it’s asking me to add my variables to the secrets, but I don’t wanna do that Do I add them to skip validation??...
Solution:
Try the following configuration src/env.ts - config ```ts import { z } from 'zod';...

wat logging services do you all recommend?

or should i stick to fly.io default logging and aws cloud watch

Download, process & reupload file from UploadThing

Exactly what the title says. I have a bunch of images on UploadThing in random aspect ratios. I need to save specific ones in a 1:1 ratio. So I would have to fetch the file within an api route handler, rescale it and reupload to uploadthing as a new 1:1 ratio image.

Clarification needed for uploadthing middleware

I'm trying out uploadthing and am trying to integrate it with Clerk for authentication. In the docs (url: docs.uploadthing.com/concepts/auth-security#protecting-unauthenticated-users-from-uploading-files) it says: Protecting unauthenticated users from uploading files You can protect unauthenticated users from uploading files via the .middleware() function in each file route. Can anyone translate that for me please. I have one middleware.ts in the root direction - what is meant my 'each file route' does that mean I put a middleware.ts in the directory that contains my page.tsx (I'm using app not pages with t3 app and nextjs) Many thanks....

Anyone know how to get AIs to output valid sources?

I'm trying to use the following prompt: ``` After the content list out the Title, Quote from the source and URL for any sources you used. Wikiepdia should not be used as a citation source. Verify all sources have an accurate and functional URL....

T3 chat and websocket

If t3 chat has been ported to convex db why don't I see a websocket connection in the network tab when I use t3 chat? Did they not shoot the new version yet or am I missing something ?
Solution:
Im pretty sure the beta is the only version of T3 chat with the convex migration