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.
AE
Ahmed Eidβ€’575d 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.
UU
Unknown Userβ€’575d ago
AE
Ahmed Eidβ€’575d 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
AE
Ahmed Eidβ€’575d ago
AE
Ahmed Eidβ€’575d ago
router ^^ @oscartbeaumont any idea what could I've done wrong ?
UU
Unknown Userβ€’575d ago
AE
Ahmed Eidβ€’575d ago
thanks cc @alex / KATT
UU
Unknown Userβ€’575d ago
AE
Ahmed Eidβ€’575d 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.
UU
Unknown Userβ€’575d ago
AE
Ahmed Eidβ€’575d 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 ?
AK
Alex / KATT πŸ±β€’575d ago
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
AE
Ahmed Eidβ€’575d ago
Disabled it and it’s working fine.
D
Dani;β€’575d 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...
AK
Alex / KATT πŸ±β€’575d ago
why the hell does a package like superjson need a subdep facepalm someone please make an alternative
AK
Alex / KATT πŸ±β€’575d ago
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 ...
D
Dani;β€’574d ago
apparently that copy-anything package (+ it's subdependency) is under 80 LOC πŸ™‚