T
tRPC

Unsafe return of an `any` typed

Unsafe return of an `any` typed

SStanley10/26/2023
I am using TRPC with Prisma. I can't seem to get rid of the TypeScript ESlint error.
import { z } from "zod";

import { createTRPCRouter, publicProcedure } from "~/server/api/trpc";

export const postRouter = createTRPCRouter({
getAll: publicProcedure.query(({ ctx }) => {
return ctx.prisma.post.findMany(); // The error occurs on this line
}),
});
import { z } from "zod";

import { createTRPCRouter, publicProcedure } from "~/server/api/trpc";

export const postRouter = createTRPCRouter({
getAll: publicProcedure.query(({ ctx }) => {
return ctx.prisma.post.findMany(); // The error occurs on this line
}),
});
Steps that I have taken: 1. npx primsa db push 2. npm install 3. Restart TypeScript and Eslint in Vscode I have been trying for hours to get this working, any help will be greatly appreciated. I am following this tutorial : https://www.youtube.com/watch?v=YkOSUVzOAA4&t=1525s up to timeStamp 24:00
Ttaylor.presto11/18/2023
I am having the same issue. I think the T3 boilerplate is broken.
DDxD11/18/2023
Did you restart eslint ? Or check what you have in eslint as settings

Looking for more? Join the community!

T
tRPC

Unsafe return of an `any` typed

Join Server
Recommended Posts
Vanilla Client AuthenticationHow to authenticate using the vanilla client? I want to consume this route as the authenticated userGeneric Zod as Input TypeI'm not positive if this is a TRPC question, typescript in general, or failure to understand Zod in Incompatible Router TypesI am working on a trpc implementation for sveltekit. I attached a screenshot of the createContext nextjs app router, "fs", "os", "zlib-sync" and trpc experimental edge RouterEnvironement: Turborepo + pnpm What's wrong: when I tried to build nextjs, the error is like this TS4111: Property 'error' comes from an index signature, so it must be accessed with ['error'].I am trying to use trpc with AnalogJs, an Angular meta framework and Nx. We use the @nx/vite builderTypeError: Cannot read properties of null (reading '_def')As the title says, I get the following: TypeError: Cannot read properties of null (reading '_def') I wanna add a localStorage persister, but I'm getting errors for hydration:I wanna add a localStorage persister, but I'm getting errors for hydration: ```js const persister =error route always getting 500 from trpc error? (next13/approuter)I've got this condition for throwing in my trpc procedure: ```ts if (!userClerkProfile) { force-cache planetscale errortrying to use the trpc API from RSCs fails and gives the following error ```log result: { data:What is the pattern for unsubscribing from a subscription?Hi there! I'd like to prevent unnecessary connections to a websocket server across multiple renders.