Chen
Chen
Explore posts from servers
TtRPC
Created by Chen on 9/22/2024 in #❓-help
Is it possible to change the base path?
I have my trpc server on an endpoint: api.examples.com/trpc - this should be the root, and trpc handles anything subsequent. But querying this with a client, I get the error:
TRPCError: No procedure found on path "trpc/me.details"
TRPCError: No procedure found on path "trpc/me.details"
Is it possible to have the trpc server factor out the /trpc part of the path?
3 replies
TTCTheo's Typesafe Cult
Created by Chen on 1/18/2024 in #questions
Running TSC on tRPC client runs type checking on tRPC server
I have a pnpm monorepo with a Vite client and a tRPC backend (sst lambda although the specifics shouldn’t matter). Whenever I run tsc to type check the client, it follows the import to the router and proceeds to apply all of the client package’s rules to the server package. Is this a known/common issue? I realise it’s not directly a tRPC problem but it seems like something other people should have run into.
3 replies
TtRPC
Created by Chen on 1/17/2024 in #❓-help
Client `tsc` checking server code
I have a trpc server and vite/react client set up in a pnpm monorepo. The VSCode type checking is behaving fine, but running tsc to build the Vite app starts trying to apply the client's typescript rules to the server's code. Is this a known issue, and is there a decent solution to this? If not, I can provide a simple repo which reproduces the issue.
3 replies
TtRPC
Created by Chen on 1/17/2024 in #❓-help
Can you ensureData without the useUtils hook?
The Tanstack Router docs recommend calling ensureQueryData in a route’s loader function if using Tanstack Query: https://tanstack.com/router/v1/docs/guide/external-data-loading#a-more-realistic-example-using-tanstack-query As far as I can tell, ensureQueryData is only available through the trpc useUtils hook in a component. Can I get it, or the full query options, some other way?
5 replies
TTCTheo's Typesafe Cult
Created by Chen on 5/24/2023 in #questions
Can you use NextJS rewrites *only* in development?
My company is incrementally adopting Next (hooray) - but the app is currently being statically exported and served from a Spring Boot app for now (boo). I’d like to have a setup similar to Vite’s server.config where requests to /api can be proxied to an external server during development, but not in production. However, next doesn’t seem to allow output: export and rewrites at the same time, but I don’t mind if rewrites stops working in production.
1 replies
TTCTheo's Typesafe Cult
Created by Chen on 4/7/2023 in #questions
How can I 'sell' React to a workplace of dinosaur devs who hate javascript?
I work at a very large and old company where for various reasons, they're always at least 10 years behind on tech. Until a few years ago, their UIs were all in Java Swing, now they're trying to move to ExtJS. It's hell. Nobody has any motivation to improve their products, everyone is miserable and struggling with the awful tech, including me. It's like they don't know there are better options and refuse to look for them. I don't get it. I can quit, but I kinda want to just see if I can make any impact at all. How can I make my miserable, uninspired, dinosaur colleagues see the benefits of JavaScript, TS, etc.? They're currently in the mindset where they see something slightly unusual like () => {} and just mentally check out. It's infuriating. I'm probably the newest person there, and it's hard to be taken seriously when the next youngest person on my team is twice my age. Idk what replies I'm expecting, I guess I just wanted to rant.
56 replies