• Error
  • Reported by the lexer and parser

TS1121

Octal literals are not allowed. Use the syntax '{0}'.

A number starts with `0` followed by digits, the legacy octal form. Write `0o` for octal, or drop the leading zero for decimal.

What it means

Numbers like 0755 were octal in old JavaScript. They're not allowed in strict mode or in TypeScript. The message suggests the 0o form with the same value.

Example

index.ts
const mode = 0755;
export {};
ts-r-check -p tsconfig.json --pretty false ts-r output
index.ts(1,14): error TS1121: Octal literals are not allowed. Use the syntax '0o755'.

Recorded by node scripts/verify-examples.mjs with ts-r built from commit 6deaf01. The example uses the default tsconfig: strict, target: es2022, module: esnext, moduleResolution: bundler.

How to fix

  • For an octal value, use the 0o prefix: 0o755.
  • For a decimal value, remove the leading zero: 755.