Skip to content
Latchkey

TypeScript "TS1484: ... is a type and must be imported using a type-only import"

verbatimModuleSyntax makes TypeScript emit imports/exports verbatim, eliding nothing. A name used only as a type must be imported with import type, otherwise tsc would emit a runtime import of something that has no runtime value - TS1484.

What this error means

tsc (or the framework build) fails with TS1484: '<Name>' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled. It appears after enabling the option, naming each value-imported type.

tsc output
src/api.ts:1:10 - error TS1484: 'User' is a type and must be imported using
a type-only import when 'verbatimModuleSyntax' is enabled.

1 import { User, fetchUser } from './user'
           ~~~~

Common causes

A type imported as a value

Under verbatimModuleSyntax the compiler does not strip type-only imports automatically. Importing a type with a plain import { Type } would generate a runtime import of a nonexistent value, so tsc requires import type.

Mixed type/value imports from one module

A single import { Type, value } mixes a type and a runtime value; the type part must be marked type (inline or in a separate statement).

How to fix it

Use import type (or inline type)

Mark type-only imports so nothing runtime is emitted for them.

TypeScript
import type { User } from './user'
import { fetchUser } from './user'
// or inline:
import { type User, fetchUser } from './user'

Autofix across the codebase

Terminal
# typescript-eslint can rewrite these automatically
npx eslint . --fix --rule '{"@typescript-eslint/consistent-type-imports":"error"}'

How to prevent it

  • Use import type for type-only imports.
  • Enable @typescript-eslint/consistent-type-imports with autofix.
  • Turn on verbatimModuleSyntax early so import-style issues surface in dev.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →