• Error
  • Reported by the tsconfig loader

TS5090

Non-relative paths are not allowed. Did you forget a leading './'?

A `paths` substitution in tsconfig.json is a bare path. Start it with `./` so it is relative to the config file.

What it means

Every substitution in compilerOptions.paths must be a relative path (starting with ./ or ../), an absolute path, or start with ${configDir}. Since baseUrl was removed, a bare src/* has nothing to be resolved against. The error is reported on the substitution in tsconfig.json.

Example

tsconfig.json
{
  "compilerOptions": {
    "strict": true,
    "target": "es2022",
    "module": "esnext",
    "moduleResolution": "bundler",
    "noEmit": true,
    "paths": {
      "@/*": [
        "src/*"
      ]
    }
  }
}
index.ts
export const x = 1;
ts-r-check -p tsconfig.json --pretty false ts-r output
tsconfig.json(10,9): error TS5090: Non-relative paths are not allowed. Did you forget a leading './'?

Recorded by node scripts/verify-examples.mjs with ts-r built from commit 6deaf01.

How to fix

  • Prefix the substitution with ./: "@/*": ["./src/*"]. It is resolved relative to the tsconfig.json that declares it.