Skip to content
Latchkey

TS2691: An import path cannot end with a .ts extension - in CI

You wrote an import specifier ending in .ts, which TypeScript rejects unless allowImportingTsExtensions is set.

What this error means

Type-checking fails with TS2691 suggesting you drop the extension.

tsc
src/app.ts(2,21): error TS2691: An import path cannot end with a '.ts' extension. Consider importing './utils' instead.

Common causes

How to fix it

Drop the .ts extension

  1. Import without the extension (or use .js for nodenext ESM resolution)
ts
import { x } from './utils'

Opt in to .ts imports (noEmit setups)

  1. Set allowImportingTsExtensions with noEmit when a bundler handles emit
tsconfig.json
{
  "compilerOptions": {
    "allowImportingTsExtensions": true,
    "noEmit": true
  }
}

How to prevent it

  • Import without source extensions unless your toolchain explicitly enables .ts specifiers.

Frequently asked questions

What causes "TS2691 import path .ts"?
Type-checking fails with TS2691 suggesting you drop the extension.
How do I fix TS2691 import path .ts?
Drop the .ts extension

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card