juico
juico
TtRPC
Created by juico on 11/22/2023 in #❓-help
trpc mutation call stuck
It seems I'm not the only one having an issue with this. There are several threads where people have the same problem that is related to next js. I hope once that is solved trpc calls will work as usual
18 replies
TtRPC
Created by juico on 11/22/2023 in #❓-help
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
TtRPC
Created by juico on 11/22/2023 in #❓-help
trpc mutation call stuck
If I call it multiple times, the same thing is happening, just seems to be completely stuck
18 replies
TtRPC
Created by juico on 11/22/2023 in #❓-help
trpc mutation call stuck
No description
18 replies
TtRPC
Created by juico on 11/22/2023 in #❓-help
trpc mutation call stuck
Not sure if I understand correctly, are you talking about something like loggerLink?
18 replies
TtRPC
Created by juico on 11/22/2023 in #❓-help
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
TtRPC
Created by juico on 11/22/2023 in #❓-help
trpc mutation call stuck
No description
18 replies
TtRPC
Created by juico on 11/22/2023 in #❓-help
trpc mutation call stuck
No description
18 replies
TtRPC
Created by Liltripple_reid on 9/4/2023 in #❓-help
useMutation throwing 500 errors
It's resolved, for some reason I was having "use client" at the top of my file. For the life of me I have no idea why I had it there.
12 replies
TtRPC
Created by Liltripple_reid on 9/4/2023 in #❓-help
useMutation throwing 500 errors
The second one: app/api/trpc/[trpc]/route.ts?
12 replies
TtRPC
Created by Liltripple_reid on 9/4/2023 in #❓-help
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
TtRPC
Created by Liltripple_reid on 9/4/2023 in #❓-help
useMutation throwing 500 errors
Hmm, still having the same error :/
12 replies
TtRPC
Created by Liltripple_reid on 9/4/2023 in #❓-help
useMutation throwing 500 errors
Same error for me
12 replies
TtRPC
Created by juico on 8/23/2023 in #❓-help
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:
const createNewDeck: UseTRPCMutationResult<{
walletAddress: string;
_id: string;
default: boolean;
readonly URL: string;
alinkColor: string;
readonly all: {
[x: number]: {
id: string;
onfullscreenchange: null;
onfullscreenerror: null;
readonly ownerDocument: {
readonly URL: string;
... 187 more ...;
readonly lastElementChild: ... | null;
};
... 95 more ...;
readonly assignedSlot: {
...;
} | null;
};
readonly length: number;
};
... 188 more ...;
deckName: string;
}, TRPCClientErrorLike<...>, {
...;
}, unknown>
const createNewDeck: UseTRPCMutationResult<{
walletAddress: string;
_id: string;
default: boolean;
readonly URL: string;
alinkColor: string;
readonly all: {
[x: number]: {
id: string;
onfullscreenchange: null;
onfullscreenerror: null;
readonly ownerDocument: {
readonly URL: string;
... 187 more ...;
readonly lastElementChild: ... | null;
};
... 95 more ...;
readonly assignedSlot: {
...;
} | null;
};
readonly length: number;
};
... 188 more ...;
deckName: string;
}, TRPCClientErrorLike<...>, {
...;
}, unknown>
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:
Argument of type '{ walletAddress: string; _id: string; .... is missing the following properties from type 'DeckDocument': adoptNode, captureEvents, caretRangeFromPoint, clear, and 66 more.ts(2345)
Argument of type '{ walletAddress: string; _id: string; .... is missing the following properties from type 'DeckDocument': adoptNode, captureEvents, caretRangeFromPoint, clear, and 66 more.ts(2345)
8 replies
TtRPC
Created by juico on 8/23/2023 in #❓-help
Type return error when using mongoose.
When I hover over user it does give me the json of all values it returns, but that is not a defined type. So I if there are other function that need a specific type like UserDocument, how do I make sure that this is UserDocument?
8 replies