vilchy ✓
vilchy ✓
TTCTheo's Typesafe Cult
Created by vilchy ✓ on 1/19/2023 in #questions
How to refetch query after mutation?
it works now, thanks
8 replies
TTCTheo's Typesafe Cult
Created by nimeshvaghasiya on 1/16/2023 in #questions
error - ReferenceError: Cannot access 'createTRPCRouter' before initialization
thanks for guiding me on the badly ordered imports trope
20 replies
TTCTheo's Typesafe Cult
Created by nimeshvaghasiya on 1/16/2023 in #questions
error - ReferenceError: Cannot access 'createTRPCRouter' before initialization
now it works form me
20 replies
TTCTheo's Typesafe Cult
Created by nimeshvaghasiya on 1/16/2023 in #questions
error - ReferenceError: Cannot access 'createTRPCRouter' before initialization
I needed to put import of createInnerTRPCContext above import of usersRouter in [...nextauth].ts
20 replies
TTCTheo's Typesafe Cult
Created by nimeshvaghasiya on 1/16/2023 in #questions
error - ReferenceError: Cannot access 'createTRPCRouter' before initialization
without this line, it works
20 replies
TTCTheo's Typesafe Cult
Created by nimeshvaghasiya on 1/16/2023 in #questions
error - ReferenceError: Cannot access 'createTRPCRouter' before initialization
const caller = usersRouter.createCaller(ctx);
const caller = usersRouter.createCaller(ctx);
20 replies
TTCTheo's Typesafe Cult
Created by nimeshvaghasiya on 1/16/2023 in #questions
error - ReferenceError: Cannot access 'createTRPCRouter' before initialization
i found the line that causes the error but idk how else should i tackle this issue. So i wanted only approved accounts to log in so i made a signin callback which calls trpc to check if requesting user is approved (sort of a whitelist).
async signIn({ user }) {
// If the user is not verified, don't let them sign in
const ctx = createInnerTRPCContext({ session: null });
const caller = usersRouter.createCaller(ctx);
const data = await caller.isApproved({ id: user.id });
if (!data?.verified) {
return false;
} else {
return true;
}
},
async signIn({ user }) {
// If the user is not verified, don't let them sign in
const ctx = createInnerTRPCContext({ session: null });
const caller = usersRouter.createCaller(ctx);
const data = await caller.isApproved({ id: user.id });
if (!data?.verified) {
return false;
} else {
return true;
}
},
20 replies
TTCTheo's Typesafe Cult
Created by nimeshvaghasiya on 1/16/2023 in #questions
error - ReferenceError: Cannot access 'createTRPCRouter' before initialization
20 replies
TTCTheo's Typesafe Cult
Created by nimeshvaghasiya on 1/16/2023 in #questions
error - ReferenceError: Cannot access 'createTRPCRouter' before initialization
Currently having same problem. It disappears after doing any change in any file and saving it. But when I rerun the project it comes back.
20 replies
TTCTheo's Typesafe Cult
Created by vilchy ✓ on 10/31/2022 in #questions
How do you consume TRPC Next backend on other platform?
tyvm guys
10 replies