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

Prisma migration issue on vercel deployment

Hi Gang, I'm facing a persistent migration issue with my prisma model in my PostgreSQL database hosted on Railway. Here's a breakdown of the situation: My original prisma schema model was the following: ...

Struggling with CSP nonce

Hi! I'm struggling to implement a nonce based content security policy on my app. What is the recommended way of doing it in T3? The only solution so far that I could find in the next docs is to use the app router where the x-nonce header will be automatically read and attached to every script or style tag but it just doesn't do it on page router and the whole app bundle gets blocked....

Struggling with PNPM Workspaces - How to Link Local Packages

👋 Hello Devs, I'm currently working on a TypeScript package called zod-to-fields that I wish to test with multiple frontend frameworks (React, Vue, Svelte). I'm using PNPM and have set up a workspace, but I'm having trouble figuring out how to make it all work smoothly. 📂 Folder Structure...

T3 env in nextjs custom typescript server

Hello, Im trying to setup Nextjs 13 app router with custom server with typescript. So far so good I was able to get the latest tRPC setup with nextjs13 app router and custom express server entry point all in typescript. But I would Like to use T3Env in that custom express server entry point but Im failing to do so. Complaining about the esm module inported in that cusotm server file. This is insane how much you need to fiddle to get something like that working in 2023 😄 anyway... I've followed this repo from vercel to get express server entry point working but dunno how to reconfigure it so I could use env.mjs Version I've used for T3 Stack https://discord.com/channels/966627436387266600/988912020558602331/1150912514322870322 Ts custom server example from vercel https://github.com/vercel/next.js/tree/canary/examples/custom-server ...

updates to tailwind.config.ts not applying?

I have updated my tailwind.config.ts to set new theme colors all colors in the app used this definition for theme colors Unfortunately despite recloning the repo multiple times, nuking node modules, rebooting my pc. Everything I can think of for any sort of cached results, the colors are not updating... I have no manually specficied any colors in the app, everything is stuff like...

Property 'res' does not exist on type ctx

I was following along Josh's tutorial(attached below; he writes the code at the 10:10 min mark) and I faced a small problem here where it says (Property 'res' does not exist on type '{ db: PrismaClient<PrismaClientOptions, never, DefaultArgs>; }') I attached a pic of my code and how josh's code look. How can I access these parameters and change them??? github repo for the project: https://github.com/ProfMoriartey/usta-sushi Josh's video: https://www.youtube.com/watch?v=ljsxNQ-nPog&t=886s...
No description

Looking for 1-3 hour long Next tutorial, app router, server comp., server actions, local db, auth.js

I have tried to follow the Next docs, but after a while I feel I don't know basic common practices how to structure and do common things in real projects and would like to see at least one small project with these features put in place. Especially how layouts and auth and server components, work using server components and server actions. Is there something like that around? Something that is preferably only a month or few months old. What would you recommend?

How to query verceldb postgres database on vercel.com?

I created a postgres database using Vercel's Postgres solution (https://vercel.com/docs/storage/vercel-postgres). I have a local project with the usual T3 stuffs, where I created two Models (Landmark and Image). I added some data manually, so I headed to the vercel.com storage view where you can browse your database on their website. Good news, the Browse tab works - I can see both tables and the data in them! But then I found the Query tab. I typed in SELECT * FROM landmarks; and it throws Syntax error: relation "landmark" does not exist.. I've tried any number of FROM landark;, from verceldb.landmarks, FROM Landmark;, all with the same error....

Astro won't build after adding middleware/index.ts

I was adding i18n to astro and used astro-i18n-aut. This package did not work for me, so I decided to reset my repo to the previous commit. Now the project does not build anymore. It does build on vercel, so I think it has something to do with the cache. The error is below [vite]: Rollup failed to resolve import "astro-i18n-aut" from "/Users///**/src/middleware/index.ts". This is most likely unintended because it can break your application at runtime. If you do want to externalize this module explicitly add it to...

Project management and documentatio

We are pretty much down to three different paths for project management and documentation now. Which one would you folks prefer and why? 😄 1. Clickup for both documentation and project management. 2. Notion for both documentation and project management....

What are the best CI/CD tools to use?

I know ci/cd might seem a little bloated, but my siblings and are all working together on multiple side projects. I would like to say that these are more serious than typical tinder/twitter app clones and are web apps or projects we intend to make some profit off of. That being said, we are trying to incorporate more enterprise level practices and tools in terms of deployment and scaling. A lot of what we are doing is obviously overkill and not needed, but I think it can help me learn a lot about managing and building larger projects. I've been using and learning Jenkins but a lot of other people i've talked to on other discords/situations always shake their heads when I bring it up and say that Jenkins is waaaay outdated and a pain to work with. I've heard (from my brother who did contracting work for) doordash and other companies use Jenkins servers where they run thousands of builds a day, but I can see this being due to them being tied to legacy infrastructure. I personally feel Jenkins is mostly fine other than potentially a few security issues and some configuration hell, but I haven't worked intensely with other CI/CD tools. It would be nice, interesting and hopefully useful to learn some common CI/CD tools that won't be super dated, but are still flexible and configurable. Would any of you mind describing an ideal, scalable and enterprise level ci/cd pipeline you would use for (deploying, building, testing...) webapps and any other sort of large scale project? I know most of this may depend on the nature of the project and situation itself, but I am looking for pros and cons, as well as common practices/tools....

Uploadthing Express postman test?

I'm using ExpressJS to set up uploadthing for files upload. Is there a way I can test it on postman?

fetch

Need to fetch an endpoint on key stroke, how do you do that?

data branching planetscale

new to database stuff, im about to seed a database for a developer environment to test on. when im happy i was thinking i could then just merge the schema to production (without the data), looking at the docs there is a databranching feature https://planetscale.com/docs/concepts/data-branching but this is premium. I guess the usual approach is to make a separate database, but this is also another cost. Wondering how any of you planetscale users work in development?...

Custom onChange function to react-date-picker

I'm trying to use shad's custom date range picker and add it to a form. but i can't seem to pass a custom onChange function to react-date-picker...
No description

SignalR

Seeking help to start SignalR server using Node. Here's my code: (white lie, I've had chatgpt on call to help resolve but no luck) ```const { HubConnectionBuilder, LogLevel } = require("@microsoft/signalr"); ...

When to use "src/page/api/doStuff.ts" vs "src/server/api/routers/routerThatDoesStuff.ts"

I am trying to get data from a db AFTER I click a button. Correct me if i am wrong - to do this, you would use a useEffect that is dependent on a useState boolean, once true, inside the useEffect you do the fetching My 1st screenshot is the page/api option My 2nd is tRPC use query (the option i want to use). ...
No description

No response returning from api route

I'm making an api route to fetch/create a chatId for a chat room but its not returning any response, what is wrong here? ``` import type {NextRequest} from "next/server"; import {NextResponse} from "next/server";...

❌ Attempted to access a server-side environment variable on the client get's thrown in db.ts

Hi, I get a weird error in my nextjs application created with create-t3-app. It throws an error that a server-side environment variable get's accessed clientside in db.ts even tho db. should never be executed clientside. This is my env.mjs: ```typescript...
No description

Tailwind - Styles with same name but different value depending on the route

I am working on a monorepo. Each package in the monorepo counts has a route (e.g. the folder /page is the actual route that the users end up visiting with their browser) The thing is that a lot of components are shared and just change small things about the style, for example all components in /page with the style rounded should have a border-radius of 2px. But I would like all rounded classes in /page2 to have, for example, a border-radius of 4px. ...