Dor
Dor
TTCTheo's Typesafe Cult
Created by Dor on 10/13/2024 in #questions
Data Caching problem in App Router help plz
When I log in with a user who has specific data, that SAME data appears even after logging out and logging in with a different user. Why is this happening? Flow: 1. I'm entering /login and logging in with user A - Opening clients page /clients , viewing data - Logging out - Entering /login again, this time logging in with user B - Opening clients page /clients - SEEING THE SAME DATA that appeared to user A Reloading the page works, but this solution is very primitive and unacceptable to my very high standards of someone that builds stuff for 10 years and made barely $20. I'm using the T3 stack.
1 replies
TTCTheo's Typesafe Cult
Created by Dor on 9/16/2024 in #questions
T3 Stack with App router - Can't see new posts after mutation
Hey, I'm using the default T3 stack with App router, TRPC and Drizzzzzle. I have 2 pages: /posts and /posts/new. Why when submitting a new post, when I go to /posts I do not see the newly created post, only after a refresh? Please help, I'm losing my mind over App Router and kinda frankly hating it so far
5 replies
TTCTheo's Typesafe Cult
Created by Dor on 4/27/2024 in #questions
internal server error when deploying to DigitalOcean
When entering some specific pages in my site, the server gets an error and shuts down. Why is this happening? I run it locally - everything works I run it on vercel - everything works But on DigitalOcean it breaks I have a loop of errors of this type:
TypeError: fetch failed
at node:internal/deps/undici/undici:12618:11
at async invokeRequest (/home/dor/project_name/node_modules/next/dist/server/lib/server-ipc/invoke-request.js:17:12)
at async invokeRender (/home/dor/project_name/node_modules/next/dist/server/lib/router-server.js:254:29)
at async handleRequest (/home/dor/project_name/node_modules/next/dist/server/lib/router-server.js:447:24)
at async requestHandler (/home/dor/project_name/node_modules/next/dist/server/lib/router-server.js:464:13)
at async Server.<anonymous> (/home/dor/project_name/node_modules/next/dist/server/lib/start-server.js:117:13) {
cause: SocketError: other side closed
at Socket.onSocketEnd (/home/dor/project_name/node_modules/next/dist/compiled/undici/index.js:1:63301)
at Socket.emit (node:events:530:35)
at endReadableNT (node:internal/streams/readable:1696:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
code: 'UND_ERR_SOCKET',
socket: {
localAddress: '::1',
localPort: 58042,
remoteAddress: '::1',
remotePort: 45019,
remoteFamily: 'IPv6',
timeout: undefined,
bytesWritten: 5873,
bytesRead: 12394
}
}
}
TypeError: fetch failed
at node:internal/deps/undici/undici:12618:11
at async invokeRequest (/home/dor/project_name/node_modules/next/dist/server/lib/server-ipc/invoke-request.js:17:12)
at async invokeRender (/home/dor/project_name/node_modules/next/dist/server/lib/router-server.js:254:29)
at async handleRequest (/home/dor/project_name/node_modules/next/dist/server/lib/router-server.js:447:24)
at async requestHandler (/home/dor/project_name/node_modules/next/dist/server/lib/router-server.js:464:13)
at async Server.<anonymous> (/home/dor/project_name/node_modules/next/dist/server/lib/start-server.js:117:13) {
cause: SocketError: other side closed
at Socket.onSocketEnd (/home/dor/project_name/node_modules/next/dist/compiled/undici/index.js:1:63301)
at Socket.emit (node:events:530:35)
at endReadableNT (node:internal/streams/readable:1696:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
code: 'UND_ERR_SOCKET',
socket: {
localAddress: '::1',
localPort: 58042,
remoteAddress: '::1',
remotePort: 45019,
remoteFamily: 'IPv6',
timeout: undefined,
bytesWritten: 5873,
bytesRead: 12394
}
}
}
`
12 replies
TTCTheo's Typesafe Cult
Created by Dor on 12/14/2023 in #questions
Why can't I extend the user session object?
I'm using the drizzle t3 stack but unable to get this to work! I want to add a new key to the user object In other project (with prisma) it's working This is how im creating my table:
export const users = pgTable("user", { id: text("id").notNull().primaryKey(), name: text("name"), email: text("email").notNull(), field: text("field").default("testing"), emailVerified: timestamp("emailVerified", { mode: "date" }).defaultNow(), image: text("image"), });
4 replies
TTCTheo's Typesafe Cult
Created by Dor on 12/13/2023 in #questions
How to perform 2 trpc queries, when I need the second query to rely on data from the first?
Sorry for making the title so complex What I need is simple. I need to make 2 requests but get some data from the first before making the second one. This is my code which fails to work:
const { data: profile } = api.user.whoami.useQuery(); const { data: company } = api.company.getById.useQuery({ id: profile.companyId });
18 replies