How is this creating an error?

const createdResult = await ctx.prisma.quizResult.create({
data: {
score,
},
});

⛔⛔Unsafe assignment of an `any` value.eslint@typescript-eslint/no-unsafe-assignment⛔⛔
const createdResult = await ctx.prisma.quizResult.create({
data: {
score,
},
});

⛔⛔Unsafe assignment of an `any` value.eslint@typescript-eslint/no-unsafe-assignment⛔⛔
When I reload typescript server, this error goes away. But this keeps popping up over and over again throughout my codebase, and on others working on this same project as well. What is causing this? This is a fresh codebase in the T3-Stack, nothing weird has been done to it, just using default setup.
12 Replies
JacobMGEvans
JacobMGEvans2y ago
What are the steps you have done to research this on your own?
Xaohs
Xaohs2y ago
Checked if createdResult is in fact of type any or not, which it is not. Not sure what more I can do to research this. I've also tried to google this issue to see if more people are finding a similar problem with this error, but to no avail.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
JacobMGEvans
JacobMGEvans2y ago
You may need to provide a minimal viable Repro for debugging, could be an issue with tRPC and if that is the case it would need to be filed in the GitHub issues for tRPC. https://stackoverflow.com/help/minimal-reproducible-example
Stack Overflow
How to create a Minimal, Reproducible Example - Help Center
Stack Overflow | The World’s Largest Online Community for Developers
Xaohs
Xaohs2y ago
I've tried to reproduce this issue numerous times, but it is insanely incosistant and the issue dissapears when reloading IDE/TS
JacobMGEvans
JacobMGEvans2y ago
What's your dev environment? OS, Node version, IDE, etc.. @IntergalacticSurfer same question to you
lanc3
lanc32y ago
Also experiencing this same issue and it can be very frustrating. I end up having to force the type by using as to resolve the error despite intellisense displaying the correct type.
JacobMGEvans
JacobMGEvans2y ago
What's your setup too then? Might be a bug with tRPC or Prisma
lanc3
lanc32y ago
Used create t3 app about a week ago with all options enabled on Windows 10, Node 18.1, using VSC. I assume this is an eslint issue given that VSC's intellisense picked up on the correct type for me and restarting TS server would temporarily resolve the issue, but not completely sure
Xaohs
Xaohs2y ago
Node 18.1, Windows 10. Vsc/Webstorm Node 18.1 arch linux. Vsc/webstorm Node 18.1.windows 11. Vsc Node 18.1. Fedora linux. Vsc On a fresh create t3 app without any drastic changes to it.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Xaohs
Xaohs2y ago
Any updates on this from anybody? Issue still persists
Want results from more Discord servers?
Add your server