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

CORS Access Control Error Svelte Kit

Hey, I've been trying to do a fetch request on the client instead of the server, I'm hosting a static svelte site on gh pages, so I need to do things on the client. But calling these methods on the client give these errors above. Here is my code: ```ts $effect( () => { GetFindPackages( "" ).then((res) => { if ( !res ) return; packages = res;...
No description

What is the best way to define my own custom types definations?

I am trying to build some application with typescript. I was facing issues with some types like for example setting a status code for internal server error when I catch some error in the try block and setting ./src/controllers/admin.ts ``` const handleServerError = (error: unknown | any, next: NextFunction) => {...

Hello guys has anyone used Agora video chat with a Next.js application before ??

I've found a project that helps with integrating the video call feature and now I'm struggling with the whiteboard feature

newest create-t3-app (next 15) , drizzle (postgresql) and authjs v5 beta middleware problem

everything is normal before i add middleware.ts here's the errors: [auth][error] AdapterError: Read more at https://errors.authjs.dev#adaptererror [auth][cause]: Error: The edge runtime does not support Node.js 'perf_hooks' module....
Solution:
my bad, sorry guys im stupid. found the solution: https://authjs.dev/getting-started/migrating-to-v5#edge-compatibility ...
No description

Failed to verify URL

Hello everyone, question about https://{{REGION_ALIAS}}.ingest.uploadthing.com/{FILE_KEY}. does "Failed to verify URL" indicate error in ANY wrong specified parameters of url or only the signature one?

Is tRPC in create-t3-app unsafe/public?

Im trying to use tRPC on the serverside to make a call to delete an user for example, will that call be publicly available to someone with more tRPC knowledge? Like, does server/api/routers/post.ts make hello available through some public api? (see the default initial create-t3-app with tRPC and nextjs)...

Recommended VSCode Extensions

Hi there, Apart from the typical ones like prisma for intellisense/autocomplete if you use prisma, what extensions/profiles/configs do you use to improve your QoL when making a webapp using ct3? My primary concerns right now are:...
Solution:
Prettier and eslint, eslint can help by warning some common mistakes like react exhaustive deps. what is wrong with your dev servers, there shouldnt be the need of any extensions for that. Tailwind CSS IntelliSense is nice if you use it....

can T3 stack build big apps like erp system ?

Hello, I am using T3 stack for over a year now and its very amazing and easy to use but what about large apps like erp systems that alot of users will use and it will have alot of requests per second , can T3 stack handle that or should I use normal Next JS with bun backend , please advice.

Hello how do I do authentication without Next-Auth or any other auth library?

Hello, I would like implement a session based authentication in my t3 app but without Next-Auth or any auth library, this might be a dumb question but I really don't know where to start. I know how to do it using Express, or Fastify though but i don't how to do with this stack and tempalte, is it using Express behind the scenes so I need to use express-session or what. ...

Automatic audio upload to Uploadthing

i'm producing a music application with user feedback and i need it to upload the file after recording and receive the link to send it to the comparison api, but unfortunately it's returning this message. i already use uploadthing in other areas of the application and it's 100% functional MY CODE https://justpaste.it/c56un...
No description

Using getSignedURL function

#questions #uploadthin Hello I Wanna ask about getSignedURL method, doesn't work like presigned URL in aws ? This function takes a key (image unique key) as first argument but I'm not understanding how should I pass a key for the image that hasn't uploaded yet, that key will be returned only after uploading that file, In addition after uploading an image from the dashboard directly and using the key of the image the getSignedURL function will return the image URL but inside an object with URL ....

Create T3 Turbo - Caller Not Exported

Is there a reason the caller here is not exported? How would we go about using TPRC in a server component without the caller. Thank you!
No description

Weird tech stack from coding assignment

I just got a coding assignment that ask me to use Next.js with Fastify (backend) and tRPC. As I understand it, tRPC uses typescript to connect the frontend and the backend. I've used tRPC in Next.js as the frontend and backend. But how exactly does tRPC work when the frontend and backend are separated? Is my understanding of tRPC wrong? Wouldn't fontend and backend need to be in the repository for tRPC & typescript to work?

Recommended abstract syntax tree for JavaScript/TypeScript

For context, I'm trying to create a Eslint plugin to detect JavaScript runtime compatibility issues. So I need to keep track of variable types - a bit like how TypeScript keeps track of types. I find the way Eslint exposes the AST to be quite limiting....

Next JS just for frontend / Alternatives

Hi, I am mostly backend engineer and from frontend I know pure JS, TS and some basic React functionality. I have to rewrite some django apps with jquery to Go and some frontend but I can't use and also don't want SPA so simple React is out. I will use session authentication with cookies....

Barrel files?

Is it worth migrating a Next.js repo off of barrel files? I don't think they should impact bundle size from what I've read as long as you have sideEffects: false, in package.json. But if there's edge cases where they do, this would be a good reason. The main reason I can find is build time, dev build time, and test time as well as maintainability of the extra code....

callback url for uploading videos?

i'm trying to get the callback url for when i upload video but it doesn't work, it only works when i upload 1-2 seconds video but when i try uploading longer videos that are around 18-40s i don't get call back url
No description

Is this uploadthing only the Turborepo/t3 stack kind of setups

I have a Nodejs backend and NextJs frontend. Can't I just create an API with /api/uploadthing and use that as nrml api and call with formdata as body? I tried creating the api, it didn't work for me when we try that in postman with form data. But it will connect when we use UploadthingButton made using generateUploadButton, but when I try to use that button it throws below error. Error: ``` Error uploading file UploadThingError: Invalid token. A token is a base64 encoded JSON object matching { apiKey: string, appId: string, regions: string[] }....

XHR/Axios Progress with Server Actions

Hello, I'm looking into a way to use the NextJS 15 Server Actions to upload files to an S3 bucket (which I have implemented and is working); however I am now trying to get the progress of the file upload and use that in a progress bar. I have tried looking into XHR and Axios but have only been able to find the solution for API routes and not Server Actions....
Solution:
I have figured a possible solution? However, I'm unsure if it makes sense to do so or just seems redundant? But I have created an API route to effectively collect the data; then send it to a controller to separate the formData and create different variables for the files and the payload; then I pass that controller data down to the server action. This does seem to be working....