trpc error when deploying t3 app to AWS using sst
Deleted a different post about this issue. I'm trying to setup a t3 app on AWS and it is partially working. When I submit a new post using the CreatePost component, the page doesn't refresh and the error message I get is
If I manually refresh the page, the new post is updated in the UI, so it's hitting the db. When I check the network tab, the tRPC request I made returns with a 200 status code but the response is
The trpc method is just this:
Anyone having similar issues with this?
TRPCClientError: Cannot read properties of undefined (reading 'resolve') at a.from (https://....)If I manually refresh the page, the new post is updated in the UI, so it's hitting the db. When I check the network tab, the tRPC request I made returns with a 200 status code but the response is
47
{"0":{"result":{"data":{"json":null,"meta":{"values":["undefined"]}}}}
1
}
0The trpc method is just this:
create: publicProcedure
.input(z.object({ myData: z.string().min(1) }))
.mutation(async ({ ctx, input }) => {
// simulate a slow db call
//await new Promise((resolve) => setTimeout(resolve, 1000));
await ctx.db.insert(posts).values({
myData: input.myData,
});
}),Anyone having similar issues with this?
Solution
I didn't end up figuring out the issue, but I tried using server actions instead of tRPC and they do work, for anyone else having this issue.