iway1 / trpc-panel

MIT License
663 stars 50 forks source link

[Bug] No reponse is displayed for successful query when superjson is not used #33

Closed jedzej closed 1 year ago

jedzej commented 1 year ago

My setup:

No response displayed when I'm not using superjson image

I sniffed that the following error is raised

Error: undefined
    at Object.onSuccess (http://localhost:7997/api/v2/trpc/panel:1076:42573)
    at u (http://localhost:7997/api/v2/trpc/panel:1076:36707)

It works correctly with superjson enabled: image

This panel library is great, I think it'd be greater if it worked without superjson, many people don't really need it in their setups (me included).

iway1 commented 1 year ago

Hmm superjson should be opt in only and it should work without it.

I tried to reproduce this issue locally and wasn't able too (I was able to receive a response correctly). Are you sure that neither renderTrpcPanel and initTRPC.create include superjson?

If it does and you're still finding issues, could you provide the full code example including your trpc initialization code?

jedzej commented 1 year ago

Thanks for the answer. I managed to get it working without superjson with following latest libraries version:

"@trpc/client": "10.9.0",
"@trpc/react-query": "10.9.0",
"trpc-panel": "1.2.5",

Just food for thought - It'd be great if trpc-panel versioning followed trpc's, so it'd be more obvious which versions' constellation was at least tested with each other.

I'm closing this ticket.

iway1 commented 1 year ago

@jedzej that's kind of hard b/c IDK when trpc is going to release new versions and what not. Although, I could at least set my version to 10.0.0 to indicate it's for trpc v10, would that be helpful?

I don't test against new minor versions or anything, as the trpc stuff I'm using isn't going to change unless a new major version is released (at least that's what Katt said when I asked him lol)

jedzej commented 1 year ago

@iway1

I could at least set my version to 10.0.0 to indicate it's for trpc v10, would that be helpful?

IDK, rather not, at least that wouldn't help me when I was experiencing this issue. If you cannot follow it, then maybe it's not worth trying.

I don't test against new minor versions or anything, as the trpc stuff I'm using isn't going to change unless a new major version is released (at least that's what Katt said when I asked him lol)

totally understandable!