"Unsafe assignment of `any` value

I am using latest create-t3-app with prisma, tailwind nextAuth and trpc
P
pach378d ago
// src/server/admins.ts
import { prisma } from "./db";


export async function userHasPermission(userId: string, permission: string): Promise<boolean> {
const adminProfile = await prisma.permissions.findFirst({
where: {
userId
}
})
//TODO: check permission
return true
}
// src/server/admins.ts
import { prisma } from "./db";


export async function userHasPermission(userId: string, permission: string): Promise<boolean> {
const adminProfile = await prisma.permissions.findFirst({
where: {
userId
}
})
//TODO: check permission
return true
}
here is all i have right now the errors im getting are
Unsafe call of an `any` typed value. Unsafe assignment of an `any` value. Unsafe member access .findFirst on an `any` value.
all on line 5 (const adminProfile = ....) nevermind just had to restart vscode not just the ts server lmao
H
Hunter350d ago
Relaoding vscode worked for me too 🤦‍♂️ I'll just throw that 15 minutes into the fire. Thanks for the post
B
barni195d ago
🤦‍♂️ spent an !!!hour figuring this one out xx
Want results from more Discord servers?
Add your server
More Posts
Clerk + Next.js app router <SignedOut> children not rendered after <UserButton> sign outHi there! I'm currently building an app with Clerk and I've got signing in working however when I siturbo repo built lint errorI was setting up ct3turbo when I saw the GitHub action workflow is showing errors, how do I fix it?changing col-span with template literalany idea why this isnt working?[Solved] T3 Stack PWA ??Does anybody know how to turn a t3 site into a PWA? I am using next-pwa but I am getting a few errortRPC Error: Invalid hook call.Sorry for the noob question I just cant figure out how to do this I have the following tRPC route: eStack?Hey how would I go about creating a website where you can post minecraft servers and include a imageHow would I order by the role?Hello, I'm trying to set up an API, where I return some users. I've got it working, where it returnsPrisma Create with Connect IssueHey! I wasn't able to find another thread explaining this, but I'd love help with this! I have twoGenerating image background jobI'm making a game where you can create levels in HTML5 Canvas and upload them to the api. I will neeHelp with Vercel deploymentHi folks, I am having issues deploying to vercel. I keep getting this error:My DB shouldn’t be this slow, RIGHT❓A fresh DB (pscale) and Table with just two entries, but takes 10s to fetch them (prisma studio) I’❌ tRPC failed on profile.getUserByUsername: No "query"-procedure on path "profile.getUserByUsername"I am a bit lost. This is the profileRouter. export const profileRouter = createTRPCRouter({ getUHelp with Prisma Validator static evaluationI am trying to build a helper function that will allow me to abstract away some deeply nested includDoes invalidate(); perform an actual refetch?I am half way into the course video and I see `void ctx.post.getAll.invalidate();` to show the new p