TS6133: 'x' is declared but its value is never read TypeScript Origin: On your device OSI layer 7 · Application Last updated 5 Nov 2026

TypeScript: error TS6133: 'x' is declared but its value is never read.

noUnusedLocals/noUnusedParameters flag an unused variable, import or parameter.

Exact message you may see error TS6133: 'x' is declared but its value is never read.'x' is declared but its value is never read. ts(6133)TS6133 declared but its value is never readerror TS6196: 'Foo' is declared but never used.error TS6192: All imports in import declaration are unused.
Seen on: TypeScript

Meaning

Remove it, use it, or prefix parameters with _ (_req). For imports, delete the unused import (organise imports). To relax, disable the option in tsconfig — many teams leave it to ESLint instead. Build errors in CI often come from this strict flag.

Common causes

  • Unused import/variable
  • Unused function parameter (Express req)
  • Leftover debug code
  • Destructured value unused
  • noUnusedLocals enabled

⚡ Quick fix

  1. Remove or use the identifier
  2. Prefix unused parameters with _
  3. Disable noUnusedLocals/Parameters or handle via ESLint

Detailed fix by platform

TypeScript

  1. app.get("/", (_req, res) => res.send("ok"));

How to diagnose

  1. Identifier — Needed?
  2. Parameter — _prefix?
  3. Option — Enabled?

🔧 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 '.…Failed to compile: ESLint errors during next build — Next.js: Failed to compile. ./src/app/page.tsx 12:7 Error: 'x' is assigned a value but never used. @typescript-eslint/no-unused-vars (Next.js)Failed to compile: ES…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…TS2379/TS2375: exactOptionalPropertyTypes error — TypeScript: error TS2379: Argument of type '{ name: string; age: undefined; }' is not assignable to parameter of type 'User' with 'exactOptionalPropertyTypes: true' (TypeScript)TS2379/TS2375: exactO…TS2564 — TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor (TypeScript)TS2564TS2578: Unused '@ts-expect-error' directive — TypeScript: error TS2578: Unused '@ts-expect-error' directive. (TypeScript)TS2578: Unused '@ts-e…TS6133: '…

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.