DEV Community

SEN LLC
SEN LLC

Posted on

A TypeScript Error Code Reference Explained in Japanese — 35 Common Errors

A TypeScript Error Code Reference Explained in Japanese — 35 Common Errors

Type 'string' is not assignable to type 'number' (TS2322). What does this actually mean, what causes it, and how do you fix it? The TypeScript compiler gives you the code and a one-line message, but the real answer is usually "one of these three common causes." This reference groups 35 common TypeScript errors with bilingual explanations, real cause lists, example code, and fix patterns.

Every TypeScript developer has opened stackoverflow.com/questions?q=TS2322 more times than they'd like to admit. The compiler error is terse; the actual explanation is in community threads. A structured reference with categorization, search, and Japanese translations is a useful tool for both beginners and experienced devs.

🔗 Live demo: https://sen.ltd/portfolio/ts-errors-jp/
📦 GitHub: https://github.com/sen-ltd/ts-errors-jp

Screenshot

Features:

  • 35 common TypeScript errors (TS2322 through TS18048)
  • 5 categories: type / strict / missing / module / misc
  • Search by code or keyword
  • Bilingual Japanese / English descriptions
  • Causes, trigger example, fix example per error
  • Related compiler flags
  • Dark / light theme with persistence
  • Zero dependencies, 30 tests

Data structure per error

{
  code: 'TS2322',
  category: 'type',
  title: {
    en: "Type 'X' is not assignable to type 'Y'",
    ja: "型 'X' を型 'Y' に代入することはできません",
  },
  description: {
    en: 'A value of one type is being assigned to a variable of an incompatible type.',
    ja: 'ある型の値を、互換性のない型の変数に代入しようとしています。',
  },
  causes: {
    ja: [
      '変数の型と代入する値の型が一致しない',
      'オブジェクトの余分なプロパティ',
      'null / undefined を非 null 型に代入',
    ],
  },
  example: `const count: number = 'hello'; // TS2322`,
  fix: `const count: number = 42;`,
  relatedFlags: ['--strict', '--strictNullChecks'],
}
Enter fullscreen mode Exit fullscreen mode

Categories help with filtering: if you're debugging a strictNullChecks issue, you can filter to just the strict category and see all related errors in one place.

Search across both languages

export function searchErrors(query, lang = 'ja') {
  const q = query.toLowerCase();
  return ERRORS.filter(err =>
    err.code.toLowerCase().includes(q) ||
    err.title[lang].toLowerCase().includes(q) ||
    err.description[lang].toLowerCase().includes(q)
  );
}
Enter fullscreen mode Exit fullscreen mode

Simple substring matching, but searches the code, title, AND description. "implicit any" finds TS7006 regardless of whether you're browsing in Japanese or English, because the search uses whichever language is currently active.

Common errors covered

  • TS2322 — Type 'X' is not assignable to type 'Y' (the most common one)
  • TS2345 — Argument of type 'X' is not assignable to parameter of type 'Y'
  • TS7006 — Parameter 'x' implicitly has an 'any' type
  • TS2307 — Cannot find module 'x' or its corresponding type declarations
  • TS2531 / TS2532 — Object is possibly 'null' / 'undefined'
  • TS2339 — Property 'x' does not exist on type 'Y'
  • TS2304 — Cannot find name 'x' (typo? missing import?)
  • TS2554 — Expected N arguments, but got M
  • TS2588 — Cannot assign to 'x' because it is a constant
  • TS2769 — No overload matches this call
  • TS6133 — 'x' is declared but never used (noUnusedLocals)
  • TS18047 / TS18048 — 'x' is possibly 'null' / 'undefined' (newer variants)

35 total. Each has causes, example, and fix.

Why bilingual matters

Japanese TypeScript users often search error codes on Japanese-language blogs first. But the authoritative information is in English (official docs, GitHub issues). A reference that maps between the two — showing both the Japanese explanation and the original English phrasing — helps when you need to switch modes (reading official docs vs explaining the error to a teammate).

Series

This is entry #63 in my 100+ public portfolio series.

Top comments (0)