mey
TTCTheo's Typesafe Cult
•Created by mey on 2/11/2024 in #questions
Really obscure TypeError when starting Next.js
I have zero clue what's causing this but i just cloned my project on my mac after having developed it on windows for some time and i literally can't start the dev server due to this error, none of my pages load, and if i do not resolve this I will not meet the project deadline.
here's a hastebin because discord bad https://hasteb.in/F3PcqE4BWtMopGQ
16 replies
TTCTheo's Typesafe Cult
•Created by mey on 8/16/2023 in #questions
Regular Hexagon Plane using BufferGeometry in React Three Fiber
Pretty self explanatory but i can't seem to wrap my head around this one last bit. I have all the math for the vertices properly done but it seems like there's just this middle bit missing and I can't for the life of me figure out why (image attached) https://i-work-at-the.cocaine.institute/Lizzy64dd1efeWvDArpZ3jKuW.png
My code for the HexTile component:
Also, an R3F tag would be cool for those that know it and three well to find and answer questions.
2 replies
TTCTheo's Typesafe Cult
•Created by mey on 1/18/2023 in #questions
Prisma: filter include statement by nullable relation, exclude when null
I have the following code, being used to get a cart on a user session.
This results in the following error:
The items all need a product so that i can calculate a price. Unfortunately I have to work off an older schema as this is a rewrite of a site that was previously written using ASP.NET. The previous developer used the
Item
model for multiple purposes hence why it doesn't always correlate to a product, and instead sometimes to an order.
I understand the problem here but cannot reach a solution that doesn't involve manually casting to the non-nullable type, which I'd like to try and avoid.1 replies
TTCTheo's Typesafe Cult
•Created by mey on 11/15/2022 in #questions
Websockets & Connection Upgrade on Next server
So i've been trying to bind a websocket connection from client to server on next, and i've done my usual server flow for this kind of shit:
and connected to it like so, with a context:
This only results in a pending handshake or a client error where it says i'm not in a context (the latter of which only happens when i leave out the useEffect and undefined check on the client)
https://i-work-at-the.cocaine.institute/Lizzy6373b0daKzIbzcbyX5xU.png
I've done the same deal with socket.io before with no problem and this seems to be the recommended way of doing this according to the google
wtf is going on lol
7 replies
TTCTheo's Typesafe Cult
•Created by mey on 10/8/2022 in #questions
Credentials Auth with tRPC
I'm rebuilding a client's site with the T3 stack. We originally had to do away with NextAuth because we figured its
CredentialsProvider
wasn't going to work for us. Then we moved to Strapi and after using Strapi I decided I'm just gonna do it myself. <Insert Thanos GIF>
We still need to authenticate users based on username/password credentials, and I'm not sure how tRPC handles that within its ctx
since according to NextAuth docs (https://next-auth.js.org/providers/credentials) it doesn't store session data in the DB.12 replies