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(13) API call cache MISS

Hey everyone hoping for some help with an issue that is cause me a mountain of headaches. My app is having webhooks forwarded to my API route from StipeCLI. if a certain event type is forwarded I want to fetch an API route in my Next app. shown below: (BEEN STUCK FOR A WEEK< PLZ HELP) ```ts switch (event.type) {...

Recursive References in TypeScript

I'm stuck with a very specific TS/JS problem, which may not be solvable but I thought I'd see if anyone here has a cool idea on how to solve it. So I have a file index.ts with a mapping from some keys to objects: ```ts import A from "a.ts";...

Refresh a RSC

Hello, Is there a way to have a server component refresh itself programmatically? Essentially I have a server action that runs and then I want to have a specific server component rerender. Thanks!...

How to add Headers to tRPC route?

Does anyone know how I can pass custom headers when calling a tRPC route? I would like to append custom headers when calling one of my routes i.e import {api} from "~/utils/api"; ...

Update Clerk Organization from TRPC Router

Hello, if anyone got an idea on how to handle this I would highly appreciate it. I have some organizations in my app and I have stored some information on the publicMetadata. I have a settings panel where an admin user will be able to change this information....

Anyone successfully used PWABuilder for a NextJS app with tRPC?

I'm working on an application and would like to create an app on the app stores for it. Problem is it's the create-t3-app stack and it will have notifications that I'd like to propagate.

"createContext only works in Client Components." When I'm not using context.

So I recently started attempting to move my Next.js app from using the Pages router to the app router. The project was using Material UI and React Query. I have a single route for '/' and I keep getting the error TypeError: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/context-in-server-component any time I attempt to introduce a component into my page.tsx ...

Quickest local db for solid start?

Is there a quick way to get this stuff going, just want it for a quick poc #solid-start

Send revalidated data alongside mutation in tRPC

Hi. How would I go about sending new data from my server when there is a mutation made? I have a query that fetches posts and it seems useless to send a mutation and once that mutation succeeds, send a new request for all new posts. Is there realistically an option to re-send the posts from the server alongside the mutation with some tRPC magic, so that it gets new state quicker? Or how should I architect this?

Typescript giving benign error: 'caller' implicitly has type 'any'...

In my T3 App I get this benign typescript error (see image) on my testCaller:
'caller' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
'caller' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
...

Fetching data directly from prisma

Hi! I am learning about Prisma, and I see that its possible to fetch data from Prisma directly in any page. Is this safe, or should this be avoided? Or should I just fetch the data from my an endpoint accessing Prisma?...

Remove favicon from create-t3-app.

I think the argument could be made for removing favicon.ico from the create-t3-app template. Chances are many people will launch their site in their prod environment before going live. And replacing favicon is probably that last thing you'll do. And then there's a good chance the default t3 favicon will be index by Google and stay there for months even after you've replaced it. Speaking from experience.....

Next 13 and weird memory leaks

Hey folks, I've been playing with the app router in a new project of mine the last couple of days and i18n is the bane of my existence right nowI'm getting errors I can't quite figure out and not even Stackoverflow could come to help so I'm hoping maybe you guys have some insight. It all started when I migrated my React app to Next and experimented with internationalization and the /app/[lang] directory. Here's the repo for reference: https://github.com/alvarnydev/buythattrack.com/tree/dev Sometimes I'm getting this error: https://stackoverflow.com/questions/67652612/chunkloaderror-loading-chunk-node-modules-next-dist-client-dev-noop-js-failed...

Figma/SVG vs D3 vs other libraries for programmatically generating music/chord charts

I haven't tried creating SVGs yet or D3 (or any charting library) so i'm not really sure what route i should go with but, what would be a relatively easy path for generating charts like the attached picture? (i'll also have to color the sectors dynamically) I'll also be making custom piano chord/scale charts (ping me)...

t3-env issues with Vitest test cases

It looks like client environments are not being read. No issues with the server envs.
No description

big data question

I have a Neo4j database with a lot of animals that I need to calculate the mean kinship of the animals for, this is gonna be done like once a month. Right now the db is crashing big time and 34gb of ram was needed to calculate it for a single animal far down the population when it is only 1000 animals in the current dataset. Does someone have any ideas or thoughts does someone have any ideas on how this could be done in a way that the db and server could handle processing?

get S3 Object (pdf) and display it on a unique url based on object name

Hi, I currently have multiple pdfs held on S3 and I'm building an app where I need to display these PDFs based on the name of the object. For example, I have a pdf named photosynthesis 1.pdf, it's held in the biology/ folder and I need to display this pdf on domain.com/exams/{biology}/{photosynthesis 1.pdf} How can I make it so that when a user visits this url, it displays the pdf related to that url on the site. Or should I approach this differently? I've tried searching but couldn't find anything that worked, I'm pretty new to S3 so I'm a little lost. Another option I'm considering is waiting on upload thing to support pdfs and using that instead but I'm not sure when that will be ready and I need to finish the site ASAP....

T3 and App Directory

Hello there, guys! I just wanted to see if the T3 app stack properly works with the app directory. Please let me know. Thank you very much!...

Scraping Web Page Question

What tool or method can I use to extract specific information from a single web page for my Chrome extension, without the need for extensive web scraping of multiple pages?