volks
volks
Explore posts from servers
TtRPC
Created by volks on 5/7/2023 in #❓-help
Set Request Headers for individual requests?
Hello everyone, I have a simple question, can you somehow add headers to the individual requests instead of doing it once during setup of the tRPC? I would like to have custom per request header that I cannot know ahead of time.
2 replies
TtRPC
Created by volks on 4/18/2023 in #❓-help
Integrate third-party added endpoints into the router definition?
Its would be cool but not too important, so I was wondering whether or not it would be possible to have dummy router configs without any actual routers. I am using SuperTokens for my Auth and it adds several endpoints to my server (/auth/signup, /auth/login and so on), and it would be cool to somehow add these into tRPC so that I could ditch custom fetch calls.
9 replies
TtRPC
Created by volks on 2/6/2023 in #❓-help
Cannot read properties of undefined (reading 'data') of res.error.data, when trpc errors out
Hello everyone, I am using @trpc/react-query alongside trpc for express, and I am experiencing a crash when I have an error
debug: Server listening on port: 3000 at development mode
error: ERROR OCCURED: '[\n' +
' {\n' +
' "code": "invalid_type",\n' +
' "expected": "object",\n' +
' "received": "undefined",\n' +
' "path": [],\n' +
' "message": "Required"\n' +
' }\n' +
']'
error: ERROR OCCURED: "Cannot read properties of undefined (reading 'data')"
/work/company/monorepo/node_modules/@trpc/server/dist/config-200d5226.js:63
const data = res.error.data;
^

TypeError: Cannot read properties of undefined (reading 'data')
at /work/company/monorepo/node_modules/@trpc/server/dist/config-200d5226.js:63:36
at Array.map (<anonymous>)
at Object.getHTTPStatusCode (/work/company/monorepo/node_modules/@trpc/server/dist/config-200d5226.js:61:38)
at endResponse (/work/company/monorepo/node_modules/@trpc/server/dist/resolveHTTPResponse-e94bc3b5.js:46:29)
at Object.resolveHTTPResponse (/work/company/monorepo/node_modules/@trpc/server/dist/resolveHTTPResponse-e94bc3b5.js:194:16)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.nodeHTTPRequestHandler (/work/company/monorepo/node_modules/@trpc/server/dist/nodeHTTPRequestHandler-b0d356ac.js:52:20)
at async /work/company/monorepo/node_modules/@trpc/server/dist/adapters/express.js:16:9
[nodemon] app crashed - waiting for file changes before starting...
debug: Server listening on port: 3000 at development mode
error: ERROR OCCURED: '[\n' +
' {\n' +
' "code": "invalid_type",\n' +
' "expected": "object",\n' +
' "received": "undefined",\n' +
' "path": [],\n' +
' "message": "Required"\n' +
' }\n' +
']'
error: ERROR OCCURED: "Cannot read properties of undefined (reading 'data')"
/work/company/monorepo/node_modules/@trpc/server/dist/config-200d5226.js:63
const data = res.error.data;
^

TypeError: Cannot read properties of undefined (reading 'data')
at /work/company/monorepo/node_modules/@trpc/server/dist/config-200d5226.js:63:36
at Array.map (<anonymous>)
at Object.getHTTPStatusCode (/work/company/monorepo/node_modules/@trpc/server/dist/config-200d5226.js:61:38)
at endResponse (/work/company/monorepo/node_modules/@trpc/server/dist/resolveHTTPResponse-e94bc3b5.js:46:29)
at Object.resolveHTTPResponse (/work/company/monorepo/node_modules/@trpc/server/dist/resolveHTTPResponse-e94bc3b5.js:194:16)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.nodeHTTPRequestHandler (/work/company/monorepo/node_modules/@trpc/server/dist/nodeHTTPRequestHandler-b0d356ac.js:52:20)
at async /work/company/monorepo/node_modules/@trpc/server/dist/adapters/express.js:16:9
[nodemon] app crashed - waiting for file changes before starting...
3 replies
TtRPC
Created by volks on 10/12/2022 in #❓-help
Losing the type between the client and server
Hello everyone, I am new to tRPC and the magic of types in typescript so I am looking for ideas as to what is happening, the client is receiving any type instead of a string
24 replies