TypeScript error

TS2694: An import() type names something the module does not export

  • Error TS2694
  • Tested with TypeScript 5.9

error TS2694: Namespace '"/project/types"' has no exported member 'Prodcut'. is reported when a dotted type name, A.B, points into a module or namespace that has no B. In a JavaScript project that almost always means an import("./types.js").Name type in a JSDoc tag, where the name after the dot is not something the module exports.

The namespace in the message is the module, shown by its resolved path (tsc prints the full path; this site's examples live at /project). For packages it can be an internal name: Express's types, for instance, appear as e.

At a glance

CodeTS2694
MessageNamespace '{0}' has no exported member '{1}'.
TypeScript's categoryerror
Listed underUnknown names and members
Turned on by No option: every checked file reports it
In .js files Reported when the file is checked: checkJs in jsconfig.json, or // @ts-check at the top of the file

The message is TypeScript's own text from its diagnostic messages file (Apache-2.0); {0} and {1} are filled in by tsc for each error.

What it looks like

order.js Error confirmed 5.9.3 TypeScript 5.9.3, run 21 October 2026: order.js(2,34): error TS2694: Namespace '"/project/types"' has no exported member 'Prodcut'. 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. order.js(2,34): error TS2694: Namespace '"/project/types"' has no exported member 'Prodcut'. 7.0.2 TypeScript 7.0.2, run 21 October 2026: the same as 5.9.3. order.js(2,34): error TS2694: Namespace '"/project/types"' has no exported member 'Prodcut'. checked 21 October 2026
/** @param {import("./types.js").Prodcut} product */error TS2694: Namespace '"/project/types"' has no exported member 'Prodcut'.
export function label(product) {
  return product.name;
}
An import() type that names something the module does not export.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": []
  },
  "include": ["*.js"]
}

What causes it

  • The type name after the dot is misspelled.
  • The module does not export that type: it is declared under another name, or in another file of the package.
  • With module set to preserve or esnext, a file without import or export is a script, so its @typedef is global rather than an export; that case is reported as TS2306 (File ... is not a module.) instead. Under nodenext every .js file is a module, so its top-level @typedef names are always exports.

How to fix it

Use the name the module exports

Fix the spelling, or find the exported name: in the editor, completions after import("./types.js"). list what the module exports. In a .js module every @typedef at the top level is exported.

order.js TypeScript 5.9.3 TypeScript 5.9.3, run 21 October 2026: No errors. 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. No errors. 7.0.2 TypeScript 7.0.2, run 21 October 2026: the same as 5.9.3. No errors. checked 21 October 2026
/** @param {import("./types.js").Product} product */
export function label(product) {
  return product.name;
}
The import() type with the exported name.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": []
  },
  "include": ["*.js"]
}

Consider @import instead

Since TypeScript 5.5, /** @import { Product } from "./types.js" */ names the type once at the top of the file, and a misspelled name is reported on that line, where it is easier to see. See the @import page.

Gotchas

  • The error is reported on the JSDoc comment, not on the code under it.
  • In a project where files without import or export are scripts, an export {} line makes a types-only file a module that import() types can point at.

Sources

Last reviewed 20 October 2026.