Closed fnimick closed 1 month ago
My very silly workaround for now:
export function getAssert<T extends type.Any>(type: T) {
return type.assert.bind(type);
}
@fnimick trpc now has builtin arktype support, use that https://github.com/trpc/trpc/pull/5958
Fixed in 2.0.0-rc.13
Report a bug
.assert
functions from types are no longer usable as passed-around functions. They must be explicitly bound.This breaks trpc's arktype integration, where they describe using
.input(type(...).assert)
to use arktype for input type validation.This
🔎 Search Terms
trpc, Cannot read properties of undefined (reading 'traverse'),
🧩 Context
System: OS: macOS 15.0 CPU: (10) arm64 Apple M1 Pro Memory: 123.61 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.13.1 - ~/.asdf/installs/nodejs/20.13.1/bin/node Yarn: 1.22.19 - ~/.yarn/bin/yarn npm: 10.5.2 - ~/.asdf/plugins/nodejs/shims/npm pnpm: 9.7.0 - ~/.asdf/shims/pnpm npmPackages: arktype: ^2.0.0-rc.12 => 2.0.0-rc.12 typescript: ^5.5.4 => 5.5.4
🧑💻 Repro