Attempting to use a runtime value (like a variable, class, or object instance) in a type annotation context.
In TypeScript, types and values exist in separate namespaces. TS2693 is thrown when you reference a runtime variable or object instance where TypeScript expects a type name.
Using the name of a class instance, a function name, or a variable name directly as a type signature instead of using typeof, or confusing namespaces and interfaces.
1const config = {2 apiPort: 8080,3 apiHost: "localhost"4};5 6// Error: TS2693: 'config' refers to a value, but is being used as a type here7function initializeApp(settings: config) {8 console.log(settings.apiPort);9}1const config = {2 apiPort: 8080,3 apiHost: "localhost"4};5 6// Fix 1: Use 'typeof' operator to extract the type of the value7function initializeApp(settings: typeof config) {8 console.log(settings.apiPort);9}10 11// Fix 2: Or define an interface/type explicitly12interface AppSettings {13 apiPort: number;14 apiHost: string;15}16function startApp(settings: AppSettings) {17 console.log(settings.apiPort);18}Simulate standard system builds to trigger compiler trace records and track memory crashes locally.
config is a runtime JavaScript object value. It does not exist in the compilation type namespace, so using it directly in settings: config is invalid.