arktypea
arktype16mo ago
francis

Is there currently a known issue with arktype + trpc compatibility?

This is with latest RC.12

TypeError: Cannot read properties of undefined (reading 'traverse')
    at assert (/node_modules/@ark/schema/out/roots/root.js:80:29)
    at inputMiddleware (/node_modules/@trpc/server/dist/index.mjs:278:33)
    at callRecursive (/node_modules/@trpc/server/dist/index.mjs:452:38)
    at Object.next (/node_modules/@trpc/server/dist/index.mjs:461:32)
    at eval (/src/lib/trpc/middleware.ts:21:15)
    at callRecursive (/node_modules/@trpc/server/dist/index.mjs:452:38)
    at resolve (/node_modules/@trpc/server/dist/index.mjs:482:30)
    at callProcedure (/node_modules/@trpc/server/dist/config-d5fdbd39.mjs:155:12)
    at inputToProcedureCall (/node_modules/@trpc/server/dist/resolveHTTPResponse-2fc435bb.mjs:46:28)`


This occurs when I do .input(type(anything).assert). If I do something such as .input((i) => type(anything).assert(i)), it works fine.

How on earth is it ending up with this being undefined when it is run this way?
Was this page helpful?