Why does import type { X } conflict with import * as X from the same module in TypeScript?
11:29 16 Jan 2026

From my understanding, import type should only introduce a symbol in the type namespace, while import * as X should introduce a symbol in the value namespace, so I would expect both to coexist. But I’m hitting a Duplicate identifier error in TypeScript.

Minimal reproducible example:

// moduleX.ts
export type X = (value: T) => T

export const map =
  (f: (x: T) => T) =>
    (x: X): X =>
      v => f(x(v))

Usage:

import type { X } from "./moduleX"
import * as X from "./moduleX"

Compiler error:

Duplicate identifier 'X'

Additional observations:

  • Each import compiles correctly when used alone

  • The error only occurs when both imports are present

  • Compilation is done using tsc (no Babel, SWC, or other transpilers)

Questions

  1. Why does a namespace import (import * as X) conflict with a type-only import of the same name?

  2. Does import * as X introduce a symbol into the type space in addition to the value space?

  3. Is there any compiler option that allows these two imports to coexist without renaming, or is aliasing the type the intended and only solution?

typescript