New T3 gallery app only gives global error

After adding Sentry and trying out the default page, I now can't seem to get the rest of the app working again. I did delete the example error page, but I updated the global error file like Theo showed in the tutorial. It seems like while the compaint is about auth, it actually is that global-error.tsx is in the main app/ directory. When I move it, the page.tsx page loads as intended. Here is the current error: ⨯ src/server/queries.ts (8:27) @ getMyImages ⨯ Error: Unauthorized at getMyImages (./src/server/queries.ts:14:29) at HomePage (./src/app/page.tsx:29:86) at AsyncLocalStorage.run (node:async_hooks:346:14) at AsyncLocalStorage.run (node:async_hooks:346:14) at Object.apply (./src/app/page.tsx:105:10) at stringify (<anonymous>) digest: "4257623417" Code snippet:
6 | const user = auth();
7 |
> 8 | if (!user.userId) throw new Error("Unauthorized");
| ^
9 |
10 | const images = await db.query.images.findMany({
11 | where: (model, { eq }) => eq(model.userId, user.userId),
6 | const user = auth();
7 |
> 8 | if (!user.userId) throw new Error("Unauthorized");
| ^
9 |
10 | const images = await db.query.images.findMany({
11 | where: (model, { eq }) => eq(model.userId, user.userId),
Is it needing me to do something about rendering the children in the layout.tsx file?
<body className={`font-sans ${inter.variable} flex flex-col gap-4`}>
<TopNav />
{children}
</body>
<body className={`font-sans ${inter.variable} flex flex-col gap-4`}>
<TopNav />
{children}
</body>
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server