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

Read replica from MSSQL to cloud for T3 app?

Hi! I plan to build a webstore with T3 stack, but the inventory data is in an old MS SQL 2014 server. I watched Theo's video where he speaks about planetscale, and I found that it can import from local dbs (and even found a "step" called replica mode, but it seems it is only for temporary use?). Any ideas/experiences what cloud db should I use for this? (replica from MS SQL 2014 and serve that data for the T3 app) Anyone using planetscale with this "replica mode"? Thanks!...

What kind of db/storage do I need?

I am trying to make an app but I am confuse by all the DB options and idk what is the best option for me. I am making a public bus tracking app for a city. There is a public API I am able to use to get the current location of all the buses in the city. So, I wanted scape that API every few seconds and store that data so I can track the performance of the buses over time and see when they are usually late/full/early, etc. the API returns the live GPS and the passenger count as well as some extra info. I ran the scraper for a couple days and it looks like the raw json (without cleaning it up for formatting it correctly) results in about 1gb/week. I can easily bring that down to 800mb/week. ...

Web Framework Suggestions! (Senior project)

Looking for web framework recommendations on a big upcoming group project. Main requirement is it has to be deployed via Azure so sadly no App router 😭 Main options look to be Angular/Blazor/React(lol)/Next 12/Nuxt and lastly Vue (https://learn.microsoft.com/en-us/azure/static-web-apps/) (Final producct is a web app that displays wildfire % for certain timeframes for an entered in address + send out alerts etc + deployed via Azure )...

Creating internal tools for company usage

Hi, I would like to develop a tool that will only be used by people at my company. I have looked everywhere, but nothing seems to satisfy my needs. Things I have considered are: Only allowing certain email domains Keeping a table of all people with access...

zustand + next trpc/client. With slightly more complex feature. Vanilla client?

The problem i'm having is that trpc are hooks and not async functions that i can call in my zustand slice. And handle the logic in one place to keep thing less convoluted. My feature is tracking crud operations on lists and items in a list. Tracking which item and list is selected. And voiding the top level get call for this data to make sure the data is up to date. As other users can have access to shared lists. I see useContext, that changes it into a async function with the added fetch method. ...

deep questions t3 prisma client doesn’t seem to update

My prisms client doesn’t seem to show the array relationships which are present in the prisms schema as shown below. I have tried restarting vscode . Installing prisma client and generating types nothing seems to works . Am I missing something ? I am looking for certificates types to be present however it is missing in the first screenshot . I need these types in a component which is using getServerSideProps in nextjs.
No description

What is a solution for inserted html with styling that overrides it's enclosure?

I have a NextJS app where I receive emails in HTML. Most of the time, they have a custom style, these styles override my whole app. How can I keep those styles enclosed in the div where I load in the html via DangerouslyInsertHTML?

Next.js AppRouter: not a valid export field

I've hit a wall when trying to add my own exports in a route.ts, side to side with GET, POST, etc ```sh Type error: Route "app/(server)/api/test/route.ts" does not match the required types of a Next.js Route. "test" is not a valid Route export field....

First component with DaisyUI and Nextjs gives runtime error

New to nextjs 13. Have only been using Nextjs 12 and less in production. Initialized a nextjs 13 for my side-project. DaisyUI was my UI library of choice. Still not very clear about how things work with Next13, kept going through the docs but not too far. Tried adding a navbar from DaisyUI both as a named export from app/components/Navbar.tsx and directly into the default layout file from Next13 and all of a sudden I am getting a runtime error. Can anyone help me with what's going on?
No description

type errors even after disabling

``json 22:32 Error: Unsafe assignment of an any value. @typescript-eslint/no-unsafe-assignment 36:9 Error: Unsafe assignment of an any value. @typescript-eslint/no-unsafe-assignment 43:11 Error: Unsafe assignment of an any value. @typescript-eslint/no-unsafe-assignment 43:23 Error: Unsafe member access .predicted_class on an any` value. @typescript-eslint/no-unsafe-member-access...

Error: <rejected> TypeError: Body is unusable

I am using the server api utapi for file upload. Even though file uploading and deleting work just fine locally. Once deployed on Vercel, I got this error: ``` Error updating door content: Promise { <rejected> TypeError: Body is unusable at specConsumeBody (node:internal/deps/undici/undici:6630:15)...

Unable to retrieve application context. Did you forget to wrap your App inside `withTRPC` HoC?

Hey, noob question but am not sure how to deal with it. I recently added tRPC to my existing project, everything except my jest tests is working fine. When I try to render a component that's calling tRPC api.example.hello.useQuery({ text: 'from tRPC' }); it breaks my tests. Not really sure how to wrap my render function withTRPC. ...

problems with next route interception

Can't really find what's wrong with this folder structure to render the @modal/sign-in modal intercepting the sign-in route.
<Link href="/sign-in" />
<Link href="/sign-in" />
It throws the following error with trying to navigate there...
No description

bun for a large scale app

hello, im going to make a large scale app and i asked about the best options for that. some friends recommended either hone with bun or fiber with Go, im not into learning a new language yet so i was wondering if using bun at this version for this type of app levels is a wise choice. I'll be happy to knw which framework is the best choice for such an apps like this...

T3 stack question: clerk vs next-auth

Glad to join guys, thank you for all your work Theo 🙏 in the video(5m ago) clerk is used , but in the init script next-auth is installed, what is the preffered and suggested way by the T3 way of doing things? what is more up to date out of them two?...

UploadThing: Struggling to authenticate uploads

I am using uploadthing for the first time. I wanted to authenticate a passkey in the middleware after I upload the image. ``` <form className="flex flex-col gap-10 backdrop-blur-sm bg-neutral-400/10 max-w-fit p-5 place-self-center mt-10 rounded-lg border border-slate-500/50"> <input type="text"...

T3env: Module not found: Can't resolve '@/env.mjs'

Hi, I am trying to use T3env for the first time but i keep getting this error in build Module not found: Can't resolve '@/env.mjs'. My env.mjs is in my src folder. here is my env.mjs file: ```ts import { createEnv } from '@t3-oss/env-nextjs';...

NODE_ENV exposed to the client? Is that okay?

I'm getting ready to test a live app using the t3 stack but basically I want my api routes to switch between localhost for dev and the actual url for live testing. the env.mjs puts the NODE_ENV as a server variable and I'm not sure why that is the case below is the code that I'm referring to...

How to create custom upload component to use with UploadThing?

UploadThing custom component is designed to be an entire section of a form. However, I'm working in a project, that involves multiple images inputs (field array), so I need a different design, something like a regular input size type of a button. Is there a way to achieve this? If there isn't, should I consider using the existing UploadThing component hidden (absolute and opacity-0) as an intermediary between my displayed component I've created, and the server? Or am I tripping?...

Get PDF with UploadThing

Hi, I'm using upload thing to store some pdfs and there is a point in my application where i want to get the pdf object to store it in my file system. I'm using this to get the pdf (const oneUrl = await utapi.getFileUrls()) but this only gives me the url and the key. Is there a way i can get the file without needing to fetch the file from the url?...