TS2693: 'X' only refers to a type, but is being used as a value here TypeScript Origin: On your device OSI layer 7 · Application Last updated 5 Nov 2026

TypeScript: error TS2693: 'User' only refers to a type, but is being used as a value here.

You used an interface/type alias where a runtime value is needed.

Exact message you may see error TS2693: 'User' only refers to a type, but is being used as a value here.only refers to a type, but is being used as a value hereTS2693 only refers to a typets(2693) 'X' only refers to a typeTS2749: 'X' refers to a value, but is being used as a type here. Did you mean 'typeof X'?
Seen on: TypeScript

Meaning

Types disappear at compile time. Use a class, enum or const for runtime values, typeof/keyof typeof for types of values, or import the runtime value (not import type). Example: instanceof User needs a class, not an interface; use a type guard function.

Common causes

  • x instanceof Interface
  • Passing an interface as an argument (new Foo(User))
  • import type then used as a value
  • Mixed type/value namespaces
  • zod schema vs inferred type confusion

⚡ Quick fix

  1. Use a class/const object for runtime use
  2. Write a type guard function isUser(x: any): x is User
  3. Import the value normally (import { Schema })

Detailed fix by platform

TypeScript

  1. function isUser(x: unknown): x is User { return typeof x === "object" && x !== null && "id" in x; }

How to diagnose

  1. Name — Type or value?
  2. Import — type-only?
  3. Runtime — Needed?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

Cannot find module './App.vue' or its corresponding type declarations — TypeScript: error TS2307: Cannot find module './App.vue' or its corresponding type declarations. (Vue)Cannot find module '.…TS1005: ';' expected / ',' expected (syntax error) — TypeScript: error TS1005: ';' expected. (TypeScript)TS1005: ';' expected …TS1128: Declaration or statement expected — TypeScript: error TS1128: Declaration or statement expected. (TypeScript)TS1128: Declaration o…TS1192: Module has no default export — TypeScript: error TS1192: Module '"./utils"' has no default export. (TypeScript)TS1192: Module has no…TS1208: File cannot be compiled under '--isolatedModules' because it is considered a global script file — TypeScript: error TS1208: 'index.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement (TypeScript)TS1208: File cannot b…TS1484/TS1205: type must be imported using a type-only import — TypeScript: error TS1484: 'User' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled. (TypeScript)TS1484/TS1205: type m…TS2304 — TS2304: Cannot find name 'x'. (Node.js)TS2304TS2349: This expression is not callable — TypeScript: error TS2349: This expression is not callable. Type 'X' has no call signatures. (TypeScript)TS2349: This expressi…TS2693: '…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.