Ahmed Eid
Ahmed Eidβ€’2y ago

extra json property added after data when consuming a query hook.

I have this issue where when consuming a RQ hook there is an extra json object that I have to use to access the data & it does not exist on the type.
17 Replies
Ahmed Eid
Ahmed Eidβ€’2y ago
I have to use version.data?.json.version when typescript suggest version.data.version which is always undefined. I'm using version TRPC v10.
Unknown User
Unknown Userβ€’2y ago
Message Not Public
Sign In & Join Server To View
Ahmed Eid
Ahmed Eidβ€’2y ago
GitHub
trpc/examples/fastify-server/src at next Β· trpc/trpc
πŸ§™β€β™€οΈ Move Fast and Break Nothing. End-to-end typesafe APIs made easy. - trpc/examples/fastify-server/src at next Β· trpc/trpc
Ahmed Eid
Ahmed Eidβ€’2y ago
Ahmed Eid
Ahmed Eidβ€’2y ago
router ^^ @oscartbeaumont any idea what could I've done wrong ?
Unknown User
Unknown Userβ€’2y ago
Message Not Public
Sign In & Join Server To View
Ahmed Eid
Ahmed Eidβ€’2y ago
thanks cc @alex / KATT
Unknown User
Unknown Userβ€’2y ago
Message Not Public
Sign In & Join Server To View
Ahmed Eid
Ahmed Eidβ€’2y ago
I understand. I figured out the issue I have to use the same transformer on both the client and the server. I was using superjson on the server but not on the client.
Unknown User
Unknown Userβ€’2y ago
Message Not Public
Sign In & Join Server To View
Ahmed Eid
Ahmed Eidβ€’2y ago
yeah, I'm unable to get superjson to work with react native. Unable to resolve "copy-anything" from "../../node_modules/superjson/dist/index.js" getting this error, do u have any idea how I might be able to fix it ?
Alex / KATT 🐱
yeah, you likely haven't setup superjson on both sides i can't debug why superjson isn't working in RN for you you could disable it
Ahmed Eid
Ahmed Eidβ€’2y ago
Disabled it and it’s working fine.
Dani;
Dani;β€’2y ago
Seems like it's a known issue with superjson, take a look here: https://github.com/blitz-js/superjson/issues/190
GitHub
Package copy-anything that replaced lodash.cloneDeep doesn't play w...
As the title says, 882feba added the package copy-anything. Unfortunately this package doesn't play well with expo. While trying to resolve module copy-anything from file `/Users/mike/bat...
Alex / KATT 🐱
why the hell does a package like superjson need a subdep facepalm someone please make an alternative
Alex / KATT 🐱
GitHub
Promote best practices / clearer boundaries / do less Β· Issue #85 Β·...
I know it's called superjson, but I think it does a bit... much, and could easily cause some unintentional vulnerabilities & bugs. I feel like things been thrown at this lib because...
GitHub
Global scope? Β· Issue #87 Β· blitz-js/superjson
Superjson is right now in a global scope - is there a design reason for this? I'd see useage being like this // utils/sj.ts import {superjson} from 'superjson' export const ...
Dani;
Dani;β€’2y ago
apparently that copy-anything package (+ it's subdependency) is under 80 LOC πŸ™‚