bcavs
bcavs
TTCTheo's Typesafe Cult
Created by bcavs on 5/23/2023 in #questions
Data coming back as undefined in T3 Stack Tutorial
I'm following the T3 tutorial and am having trouble with getting the tRPC query to resolve. I followed the tutorial up until ~26 min where I am trying to render the posts from the prisma database but data keeps coming back as undefined. And when I destructure isLoading as well, that is always true so it seems like it never finishes loading the query. const { data, isLoading } = api.posts.getAll.useQuery(); Anyone else run into this issue when following the tut? I have no clue what to do to fix it? Do I just move on and hope future code in the tutorial fixes the issue?
6 replies
TTCTheo's Typesafe Cult
Created by bcavs on 5/23/2023 in #questions
Middleware is not working
I am following the T3 stack tutorial and am running into an issue where my middleware just doesn't seem to be recognized. I have the exact same code as in the tutorial and it's in the same folder as in the tutorial but the console log is not coming through. Anyone else run into this issue and have a fix for it? import { withClerkMiddleware } from "@clerk/nextjs/server"; import { NextResponse } from "next/server"; export default withClerkMiddleware(() => { console.log("Running Clerk middleware"); return NextResponse.next(); }); // Stop Middleware running on static files export const config = { matcher: "/((?!_next/image|_next/static|favicon.ico).*)", };
2 replies