The inferred type of X cannot be named without a reference to ark/util when using Brand-Type
Author: muuvmuuvCreated Jan 6, 2026Updated Apr 18, 2026
Labelsbug
Report a bug
Search Terms
Using "Branded types" (https://arktype.io/docs/expressions#brand) results in a type error that was fixed in the past here (#1031 and #1049).
The inferred type of 'GraphqlIdentifier' cannot be named without a reference to '.pnpm/@[email protected]/node_modules/@ark/util'. This is likely not portable. A type annotation is necessary.ts(2742)Possible solutions are installing the EXACT same version and semver range as arktype uses from the locally installed package.
pnpm add -w "@ark/util@$(cat ./node_modules/arktype/package.json | yq -r '.dependencies."@ark/util"')"Context
- ArkType version: ^2.1.29
- TypeScript version (5.1+): 5.9.3
- Other context you think may be relevant (JS flavor, OS, etc.): pnpm workspace
Repro
Playground Link: https://arktype.io/playground
import { type } from 'arktype'
export const GraphqlIdentifier = type('string.lower#GID')Source: arktypeio/arktype