elysiajs / elysia-trpc

A plugin for Elysia that add support for using tRPC
MIT License
20 stars 17 forks source link

problem with building my api #3

Open krisgrm opened 1 year ago

krisgrm commented 1 year ago

so i have an interesting usecase.. i have 2 microservices, that need to talk with each other...

I setup the elysia with trpc, and I also created a small "wrapper" package, that imports trpc router and returns the trpcApi object. i did some small tests inside the package and things are working fine.

But then I import this "wrapper" into my nextjs, in order to make both APIs talk with each other and when i do that I get the error below (during build time)

../../node_modules/.pnpm/@elysiajs+trpc@0.5.2_@trpc+server@10.34.0_elysia@0.5.22/node_modules/@elysiajs/trpc/src/index.ts:19:17
Type error: Property 'path' does not exist on type 'ValueError | undefined'.

  17 |         if (check.Check(value)) return value
  18 | 
> 19 |         const { path, message } = [...check.Errors(value)][0]
     |                 ^
  20 | 
  21 |         throw new TRPCError({
  22 |             message: `${message} for ${path}`,
 ELIFECYCLE  Command failed with exit code 1.

I am using PNPM as my package manager, even for the bun project I am usign PNPM and packageManager and BUN just for the runtime

thanks for any help in advance