oldben
oldben
TTCTheo's Typesafe Cult
Created by oldben on 11/12/2023 in #questions
Next / Auth trying to create duplicate sessions and getting errors.
Sometimes when developing locally while trying to signin to discord I am getting errors where it is trying to create a new session in my DB when there is an already existing session. Is there a way to avoid this from happening at all?
INSERT INTO `stat-tracker`.`Session` (`id`,`sessionToken`,`userId`,`expires`) VALUES (?,?,?,?)
prisma:query ROLLBACK
prisma:error
Invalid `p.session.create()` invocation in
/<path_to_nodes>/node_modules/@next-auth/prisma-adapter/dist/index.js:233:44

230 const { user, ...session } = userAndSession;
231 return { user, session };
232 },
→ 233 createSession: (data) => p.session.create(
Unique constraint failed on the (not available)
[next-auth][error][adapter_error_createSession]
https://next-auth.js.org/errors#adapter_error_createsession
Invalid `p.session.create()` invocation in
/<path_to_nodes>/node_modules/@next-auth/prisma-adapter/dist/index.js:233:44

230 const { user, ...session } = userAndSession;
231 return { user, session };
232 },
→ 233 createSession: (data) => p.session.create(
Unique constraint failed .....
INSERT INTO `stat-tracker`.`Session` (`id`,`sessionToken`,`userId`,`expires`) VALUES (?,?,?,?)
prisma:query ROLLBACK
prisma:error
Invalid `p.session.create()` invocation in
/<path_to_nodes>/node_modules/@next-auth/prisma-adapter/dist/index.js:233:44

230 const { user, ...session } = userAndSession;
231 return { user, session };
232 },
→ 233 createSession: (data) => p.session.create(
Unique constraint failed on the (not available)
[next-auth][error][adapter_error_createSession]
https://next-auth.js.org/errors#adapter_error_createsession
Invalid `p.session.create()` invocation in
/<path_to_nodes>/node_modules/@next-auth/prisma-adapter/dist/index.js:233:44

230 const { user, ...session } = userAndSession;
231 return { user, session };
232 },
→ 233 createSession: (data) => p.session.create(
Unique constraint failed .....
2 replies
TTCTheo's Typesafe Cult
Created by oldben on 11/7/2023 in #questions
Help setting up primsa + planetscale with t3 app.
I have followed the docs when trying to setup a new t3 app and using all the default values everything worked fine. I then tried adding a planetscale database to the project. From what I understand everything is correct, but when trying to create a post it doesn't appear to save it in the database. I am seeing no errors from the UI or in the npm run dev output in the terminal so unsure what the problem appears to be. I have: Updated my .env file to have the database connection string. Added next auth info & discord app info Run npx prisma db push And can see the tables have populated in the planetscale web UI. Is there some other step I have missed to enable the database upserts?
3 replies
TTCTheo's Typesafe Cult
Created by oldben on 2/7/2023 in #questions
Responsive large tables?
What would you suggest for having a large table (100s of rows) with lots of columns (10-15) for displaying in a mobile view? What have you tried before with good results?
8 replies
TTCTheo's Typesafe Cult
Created by oldben on 1/30/2023 in #questions
Random webdev question
Is there a css property to update the arrow colour on a select component?
5 replies
TTCTheo's Typesafe Cult
Created by oldben on 12/2/2022 in #questions
Hot reloading in Remix
Has anyone come across a good guide for adding hot reloading to a remix site? (Must be idiot proof)
7 replies