T
tRPC

how to build tRPC and Prisma with express?

how to build tRPC and Prisma with express?

Bbackbone3/8/2023
I am using TSC as the official docs example does. But when I use paths in tsconfig.json, It does not work because of not transforming paths . Should I add webpack like nestjs doing?
UUUnknown User3/8/2023
2 Messages Not Public
Sign In & Join Server To View
Nnlucas3/8/2023
How are you building the app? Are you running with ts-node, or using tsc to transpile and then running the output code with node? esbuild or some bundle can be a good solution, but might be more complex than supporting paths. This is very useful to just add support for the path mappings at runtime: https://github.com/dividab/tsconfig-paths
Bbackbone3/8/2023
Thanks very much, I will try it. Hello, I have solved it through @vercel/ncc which can build node project into one js file . And recommend to you.
Nnlucas3/8/2023
That’s very interesting, they mention something about “binary addons”, does that mean using a native binding like a DB driver will work? Problem I’ve seen with bundlers and NodeJS is they often break these native packages
Bbackbone3/8/2023
ncc will package all your dependency, of course including prisma binary or others. And I also solve prisma binary problem using this amzing tool. I think the subject about build & deploy need add to the official docs.
Nnlucas3/8/2023
Well tRPC is just a NodeJS package, build & deploy are up to whatever repo solution you choose, and it sounds like you’ve personally gone for something quite home-rolled Might be one to provide a simple solution for in the QuickStart guide though, I’m currently having a think on that as it’s lacking in many areas
Bbackbone3/8/2023
ok, I am glad to show some code,if it could help you a little.❤️
Nnlucas3/8/2023
If there's anything you would advocate for then please do pop it here: https://github.com/trpc/trpc/issues/3947

Looking for more? Join the community!

T
tRPC

how to build tRPC and Prisma with express?

Join Server
Recommended Posts
How to infer types from input?When I call my procedure from the client I send an array of strings as an input. How can I infer theHow to infer types of a queryCoinsider the example `const hello = trpc.hello.useQuery();` I would like to export the type we get Data Visualisation/Chartsis anyone using tRPC on data visualisation (say bar chart/line chart) in a scenario close to a bankitrpc + AWS Lambda (through cdk)Hi all, has anyone successfully integrated tRPC with AWS Lambda? My current stack is API Gateway + LIs it possible to narrow an output schema if the query optionally doesn't return all fields?I have a router procedure that has an input schema that has an optional `filter` that changes the shFetching different server url than defined in configIs it possible to access the reactQuery instance and fetch different server url? I would like to useinput using z.or not working properlyi have an input like this let input = z.object({ name: z.string().optional() }).or(z.object({ How can I disable batching with fastify adapter?I cant seem to find a way to disable batching for my server, and this link doesnt help me much httpsIssue with monorepo architecture ant tRPCHi, we had an issue with batched requests that if we batch some requests they produce a TRPCClientErUsing tRPC in CRON jobsHey everyone, this might be a very stupid question, but is it possible to use tRPC inside a CRON joasync createContext for Express AdapterBeen debugging an odd behavior for the past hour, it seems like that an async function does not workIs it possible to split the router definition with the imlementation?I want to define the server router(input\output\meta) in a separate package from the server package Cache not working for `useQuery`I have a query like this: ```js const { data: article, isFetching } = api.public.getArticle.useQueryZod File Upload Validation with Open-Api Support?Hi guys, anyone know how to validate file upload with zod and get also open-api support?Zod validation and open-api support for File on the server?Hi guys, anyone know how to validate a File upload using zod? and also have open-api support?is context cached?If I put an object on the context that represents the User record from my database... ``` export asyJSON inferred router output not matchingHello. I have a procedure query which is returning Json from a postgresql db using Prisma. The type Best way to implement input based validation on a router procedureHi guys, bit of a noob. I have already created a 'protectedProcedure', ensuring the user is logged [Help] Turbo shared typesI have a turborepo with two apps (web and embed). web is a t3 stack and embed is a create-react-app.Cache SSG helper responseI'm using `createProxySSGHelpers` in GSSP with `ssr: false` in the global config. I trying to cache