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
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β’3y ago
Message Not Public
Sign In & Join Server To View
I pretty much copy pasted it from here.
https://github.com/trpc/trpc/blob/next/examples/fastify-server/src
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
router ^^
@oscartbeaumont any idea what could I've done wrong ?
Unknown Userβ’3y ago
Message Not Public
Sign In & Join Server To View
thanks
cc @alex / KATT
Unknown Userβ’3y ago
Message Not Public
Sign In & Join Server To View
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β’3y ago
Message Not Public
Sign In & Join Server To View
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 ?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
Disabled it and itβs working fine.
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...why the hell does a package like superjson need a subdep someone please make an alternative
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 ...
apparently that
copy-anything
package (+ it's subdependency) is under 80 LOC π