MugetsuM
tRPC3y ago
6 replies
Mugetsu

@trpc/server in a non-server environment Error in Azure CI

Im trying to add vitest unit tests for my trpc procedures. I followed some examples and on the local evn all works. Tests pass but in the Azure CI I get this error.
Error: You're trying to use @trpc/server in a non-server environment. This is not supported by default.
#19 7.732  ❯ initTRPCInner node_modules/.pnpm/@trpc+server@10.8.1/node_modules/@trpc/server/dist/inde***.mjs:808:23
#19 7.732  ❯ TRPCBuilder.create node_modules/.pnpm/@trpc+server@10.8.1/node_modules/@trpc/server/dist/inde***.mjs:782:33
#19 7.732  ❯ src/server/api/trpc.ts:32:56
#19 7.734      30| import { createTRPCConte***t } from './conte***t'
#19 7.734      31| 
#19 7.734      32| const t = initTRPC.conte***t<typeof createTRPCConte***t>().create({
#19 7.734        |                                                        ^
#19 7.734      33|   transformer: superjson,
#19 7.734      34|   errorFormatter({ shape, ct*** }) {
Was this page helpful?