T
T
Explore posts from servers
TTCTheo's Typesafe Cult
Created by T on 5/26/2023 in #questions
What user info do I store in my database???
I'm developing an app using both Prisma and Clerk. With the Clerk API, I can easily get all of the data stored there (like email, username, etc.) using just the user's id. I want to create a Person model in my schema, but I'm super new to data modeling and have no idea what info should go in this object. I know I want to add info that's not part of the Clerk user object, like the users non-unique display name that will be shown alongside their unique username, as well as what groups this user is a part of. I don't know if I should include any of the things that are a part of the Clerk User object in my Person model, or if I should strictly be getting those via the Clerk API. I'm also still trying to work out how the relationship between people and groups should work, but that's a separate issue. 😅
4 replies
TTCTheo's Typesafe Cult
Created by T on 5/23/2023 in #questions
NextJS with Server Components & React Native
If I want to make an app that has both a web version in next js as well as a mobile version in react native, will that be an issue if I wanna use server components for the web version? Since I wouldn’t need api endpoints to fetch data for my server components, but my mobile frontend would still need them. I could make api endpoints to get data in next and only use the for the mobile app but that feels inelegant. Is there a good solution to this?
2 replies
TTCTheo's Typesafe Cult
Created by T on 4/15/2023 in #questions
Uncaught TypeError: Om is not a function
I built a react app with vite and everything works fine in the dev server, but when I build it I get a blank white page and the console contains the error:
Uncaught TypeError: Om is not a function
Uncaught TypeError: Om is not a function
I looked where it was pointing to in the code and seems to be upset at this:
h.useState(Om(Date.now()))
h.useState(Om(Date.now()))
Which seems to be this line
const [dateTime, setDateTime] = useState<dayJs.Dayjs>(dayJs(Date.now()));
const [dateTime, setDateTime] = useState<dayJs.Dayjs>(dayJs(Date.now()));
Which seems like it's saying dayjs isn't a function, but at the top of the file I have
import * as dayJs from "dayjs";
import * as dayJs from "dayjs";
And it works as intended in the development server. It only breaks when I build. Any help would be greatly appreciated.
3 replies
TTCTheo's Typesafe Cult
Created by T on 1/26/2023 in #questions
Error when using middleware
I'm trying to use middleware in my T3 project and even with a pretty much empty middleware function, I get this error
Error [TypeError]: Class extends value undefined is not a constructor or null
What am I doing wrong?
4 replies
TTCTheo's Typesafe Cult
Created by T on 1/25/2023 in #questions
Protected routes in Nextjs?
In the past I have made protected routes using react router so that if a user is not authenticated and tries to go to a page, they are redirected to the login page and then once logged in, brought to the page they were trying to go. I’m now trying to learn Nextjs and wanna know firstly if this is the best way to ensure authentication, and also the best way to do it with Nextjs routing if it is. I’ve found varying answers online so I figured I’d ask here.
55 replies