Weird error in trpc procedure

I am writing a simple create mutation but im getting some weird ts error. I tried restarting the ts server but no luck
export const postRouter = createTRPCRouter({
create: protectedProcedure
.input(
z.object({
text: z.string().emoji().min(1),
})
)
.mutation(async ({ ctx, input }) => {
const authorId = ctx.session.user.id;

const post = await ctx.prisma.post.create({
data: {
authorId,
text: input.text,
},
});

return post;
}),
});
export const postRouter = createTRPCRouter({
create: protectedProcedure
.input(
z.object({
text: z.string().emoji().min(1),
})
)
.mutation(async ({ ctx, input }) => {
const authorId = ctx.session.user.id;

const post = await ctx.prisma.post.create({
data: {
authorId,
text: input.text,
},
});

return post;
}),
});
W
whatplan321d ago
its an eslint error not ts Ive had this problem recently too where ts has everything right but eslint says theres anys when theyre arent probably some eslint config changes you can try also restarting eslint server
A
aditya321d ago
im using the same eslint config which comes with create t3 app eslint is useful but pain in the ass
T
taff321d ago
try restarting both eslint and ts servers when this happens usually resolves the problem
A
aditya321d ago
well I opened the editor again and it works is this the only way??
SB
swaraj bachu320d ago
Yeah kinda in vs code you can type ‘>’ on the top search bar and find restart typescript server to restart, just 2 mins work !! Just takes 10 secs
T
thevalorised320d ago
Sometimes restarting ts server is not enough and you might need to close / reopen vs code
D
deforestor320d ago
Have you found a definitive fix for it by any chance?
W
whatplan320d ago
no sorry
Want results from more Discord servers?
Add your server
More Posts
405 Error with S3 Presigned URL'sI currently have a 'PDF viewer' on my website which is suppose to render a PDF from my s3 bucket andunless if want to share components / utils between packages , why we need a mono repo ? T3 cli app ?The T3 Cli have www for the website and a cli , but they dont share any thing in common except the tNeed clerk webhook exampleI have been trying to configure a webhook to be called as soon an organization has been created and GitHub Action Failing Type-Checks but Working LocallyI'm setting up an automatic github action that will run type checks on my nextjs app when pushed / plooking for some tutorialscoming from a rails background, im new to node & t3 in general, is there a tutorial i can follow to is it worth it to have meaningful errors returned from server side form validation?like is it worth it at that point to return an error for every field that is invalid from the backenGood setup for CRA + Serverless in a monorepo?Hey folks, what’s a good setup for a serverless function and a CRA in a monorepo? If I’m able to stHow to redirect with new headers back to the same page?User goes to page `/foo`, we check if this page is protected, if it is, we rewrite the page to sometThe Edge - what's the pointso as far as i know the edge move a server close as possible to your user right? but then what's thcloudflare R2 in Versel?Has anyone here used R2 in their NextJS app hosted on Versel? Trying to save money on bandwidth WhReact.FC equivalent for RSCIs there a "React.FC" equivalent for React Server Components?How do I use the return type of a function with overloads that will be returned in the same functionI'm creating a library, but I have a problem when I use a function with overloads to return itself iMedia not rendering on first try, only after a refreshHey, first of all, this is my first complex Next.js project, so it is very probable that I am doing any good resource for browser extension development?just titleRoute Guarding with nextjsHow do you implement route guarding with nextjs? Not too sure what would be the recommended way to dthe URL must start with the protocol `mongo`I have been geting this error recently, and I have no idea why. my mongodb DATABASE_URL is without "Read and Write in Next Js Is not working in production (vercel)this code is working in local environment but not working in production can anyone tell me how to reDesperate for help with Trpc resolver.How can i get resolve({ default: base64Data }); to only trigger once trpc has returned success or fuseRouter queryHow do y'all handle typescript with nextjs's query params? Currently I'm doing ```const cartId = quPassword hashing on EDGE?I'm making an app and noticing that vercel's serverless functions are taking very much time to compl