juico
trpc mutation call stuck
Ok so dug out more weird stuff going on. Not only does the request freeze, but even after I quit the app and run again the default port 3000 is still being used so it switches to port 3001.
Even after I use killall node command the port is still being in use. Now if I use port 3001 and call the trpc endpoint again, the request freezes again and after I kill the app and run it one more time the port 3001 is also still in use and it jumps to port 3002.
This is just really really strange, but I did see another think that might be an issue and that is the webpack-hmr which is I believe what next js uses, but it seems to be frozen too since it shows the same message that request is not finished yet, so I guess it waits for that webpack to finish before it takes anything else. This is just really really strange behavior I've not see before
18 replies
trpc mutation call stuck
The furthest I get to backend is a log inside createTRPCContext function. Since it tries to get the token, it returns null if it doesn't and should allow publicProcedure trpc calls.
It passes that, returns null successfully, but then when it calls the publicProcedure
getPublicUser
it just hangs and it seems like it just freezes.18 replies
useMutation throwing 500 errors
But now I'm having it on GET() as well:
Error: Attempted to call GET() from the server but GET is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.
12 replies
Type return error when using mongoose.
So for example I have another trpc procedure:
const newDeck = await createNewDeck.mutateAsync({
deckName: deckName,
walletAddress: user?.walletAddress ?? '',
image: imageUrl
})
When I hover over newDeck I can see the values:
But there is no definition of the type so when I want to use it in another method like this one:
playerDeckActions.setAddDeckToList(newDeck)
The method expects DeckDocument but newDeck is not recognized as such:
function setAddDeckToList(deck: DeckDocument) {
const currentDeckList = JSON.parse(JSON.stringify(playerDecksState.playerDecks));
currentDeckList.push(deck)
setPlayerDecks((state: any) => ({
...state,
playerDecks: [...currentDeckList],
}))
}
and so it will throw a same error:
8 replies