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

Help with webpack error

Hello! Could anyone that gets nextjs help me understand this error I get when running npm run build: ``` Failed to compile. ./app/page.tsx + 1 modules...
Solution:
i'd try creating a new app and seeing if the issue persists

combobox popover component

I'm playing around with the html popover and css anchor positioning apis to create a dropdown menu. I was just wondering if anyone could have a look at this stripped down code (almost all styling has been removed) and let me know how you could improve it (not looking for adding customization, just semantics, performance, accessibility type stuff). One thing that doesn't quite seem right to be is the use of a button for each option in the drop down, but I don't want to just use a div with click and key-press events on it....

How to restart a game

On page load, i have a function say startGame() that runs. The page contains a toggle button, on change startGame() needs to be called again since its the main function containing the API fetch. I believe that doing so will push the newly called startGame() function over the already running one in the call stack. If so, is there any way to terminate the previous function so that it will not cause any inconsistency (JavaScript) ?

-- Runing a TS files code from a Next app created with `npm` command --

Hello devs, i m bulding features for an app. that integrates users repo into the code in order to obtain info for that project , currently I run out of solutions to run this file where I wrote the github logic Here s the output in the terminal :...
No description

Status: Callback Failed

I keep seeing this on my dashboard, not sure what to do. am i missing something ?
No description

React implementation with Three.js (React Three Fiber)

is there a template or more guided tutorial or resources about how to get a easy setup, I need to implement it in a simple project Thnk you...

Proxy for ssh protocol

I am building a project where i want to give ssh access to containers on the same host. How do i proxy ssh based on some parameter , like username.

Tips/resources to make websites look like this "simplistic modern" feel? idk the exact words lmao

Very very new frontend dev (coming from backend, go to be more specific). found a couple of websites that i would love recreate and use for my own stuff. those are: https://fumadocs.vercel.app/ https://www.better-auth.com/ the classic https://linear.app/...

Data Fetching with React 19

So React 19 is all about coming up with new patterns of Data fetching. I was figuring out how to do this in a hobby project. Below is a code, simply takes in a text and generates a QR code. The qr code is just an example for async await action. ```js const generateQRCode = async () => {...

Advice on how to switch over to web development with previous software development experience

Hi! I'm pretty new to software development - started out with Lua in Roblox Studio, moved to Unity where I picked up some C#, and then got into Flutter w/ Dart. I've been playing around with my home server too, so I get the basics of how websites and the internet work. I'm looking to dive into web dev mostly for fun and to add another skill to my skill tree. Right now I know a bit of HTML and CSS, but no JavaScript yet. I've got some stuff I definitely want to try out: - TypeScript (seems cool) - React...

NextAuth + Authetik gives me "unexpected HTTP status code"

I just want to integrate Authentik and NextAuth returns this error: "[auth][error] OperationProcessingError: "response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)" and idk where I can find the response body. Can I somehow log it. New to NextJS :)

Best places to learn about rest api's and resources for building one.

Hey all, i've kinda figured out my next pet project in javascript learning that I asked the community in the career channel (thanks by the way) but while i'm doing that I'd also like to learn more a bout rest api's and the backend regarding account creation/and data hosting. does anyone know any good books or youtube channels to learn more about it (i've been focusing on the front end so far so i'm lost on the back-end stuff still). seriously thanks to everyone for all the help this discord has given me, and the confidence you guys give others, truly made me feel like it's okay to not know things!...

Is this a safe use of reading a ref during render?

I'm creating a popover component. I want it call a template function provided by a parent component, giving it a call back that updates some state and closes the popover. This is the basic of how I've set it up but I'm getting an eslint error about reading a ref during render. ```tsx...

Access cookies in middleware?

I found two patterns to access cookies in middleware, are they equally good? 1. From https://nextjs.org/docs/app/building-your-application/authentication#optimistic-checks-with-middleware-optional ```ts export default async function middleware(req: NextRequest) {...
Solution:
It seems that the first option is better for long term maintenance: https://nextjs.org/docs/app/api-reference/functions/cookies#good-to-know

Error building nextjs application on vercel

When building my application on vercel it fails for some reason and i'm not sure why, it builds fine locally but fails on remote. this is the error i'm getting: ```bash Running "bun run build"...
Solution:
The issue seemed to be the following: 1. instrumentationHook was not set in nextjs config: ``` experimental: { instrumentationHook: true,...

Weirdest bug with RadixUI toast + Framer motion

To reproduce: 1. Open a toast by pressing Notify 2. Close it 3. Press on Notify again ...

onUploadComplete is not being called

hey! so after uploading an image on uploadthing, i want to store the link to the database through onUploadComplete but it seems to not be working, is there something im missing here?
No description

Are Serverless functions the right thing for me?

Hi there I want to build a small website that tests keyboards. Only I will test those keyboards and add them to the website. There will be no way for a viewer to comment etc. so my idea was to create a object inside a worker/function and use the worker as a database and "serverless backend" to retrieve the data, to keep the cost to free tier. If it becomes bigger then there is a reason to get a database etc because people are interested in my website, so it's an investment....

Using cookie authentication with Uploadthing?

Hey, I'm using Fastify and React and I am using cookies for authentication. But it the UploadButton from Uploadthing does not include credentials with fetch. I saw a comment in #uploadthing saying to change fetch but this is a uploadthing/server thing, not a client option. Is this possible using @uploadthing/react? If so, how?...
Solution:
I found the answer here: https://discord.com/channels/966627436387266600/1102510616326967306/1320770031155413042 tldr: wait until the next update 😅...

tRPC findUnique problem

I am having this issue with tRPC which driving me crazy
No description