TypeScript error

TS2614: A named import of a default export

  • Error TS2614
  • Tested with TypeScript 5.9

error TS2614: Module '"./slugify.js"' has no exported member 'slugify'. Did you mean to use 'import slugify from "./slugify.js"' instead? is reported when the braces of a named import ask for a name that the module exports only as its default. TS2613 is the opposite mistake: import formatPrice from "./format.js" for a module with named exports and no default.

Both messages already contain the fix. They are common when a module changes from export default to named exports (or back), and when code moves between CommonJS habits and ES modules.

At a glance

CodeTS2614
MessageModule '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?
Also on this page: TS2613 Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?
TypeScript's categoryerror
Listed underModules and imports
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 messages are 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

page.js Error confirmed 5.9.3 TypeScript 5.9.3, run 21 October 2026: page.js(2,10): error TS2614: Module '"./slugify.js"' has no exported member 'slugify'. Did you mean to use 'import slugify from "./slugify.js"' instead? page.js(4,8): error TS2613: Module '"/project/format"' has no default export. Did you mean to use 'import { formatPrice } from "/project/format"' instead? 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. page.js(2,10): error TS2614: Module '"./slugify.js"' has no exported member 'slugify'. Did you mean to use 'import slugify from "./slugify.js"' instead? page.js(4,8): error TS2613: Module '"/project/format"' has no default export. Did you mean to use 'import { formatPrice } from "/project/format"' instead? 7.0.2 TypeScript 7.0.2, run 21 October 2026: the same as 5.9.3. page.js(2,10): error TS2614: Module '"./slugify.js"' has no exported member 'slugify'. Did you mean to use 'import slugify from "./slugify.js"' instead? page.js(4,8): error TS2613: Module '"/project/format"' has no default export. Did you mean to use 'import { formatPrice } from "/project/format"' instead? checked 21 October 2026
import { slugify } from "./slugify.js";error TS2614: Module '"./slugify.js"' has no exported member 'slugify'. Did you mean to use 'import slugify from "./slugify.js"' instead?
import formatPrice from "./format.js";error TS2613: Module '"/project/format"' has no default export. Did you mean to use 'import { formatPrice } from "/project/format"' instead?

export const url = `/products/${slugify("Cotton tee")}?p=${formatPrice(1999)}`;
Named import of a default export, and default import of named exports.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": []
  },
  "include": ["*.js"]
}

What causes it

  • The module uses export default function slugify and the import says import { slugify } (TS2614).
  • The module uses export function formatPrice and the import says import formatPrice (TS2613).

How to fix it

Write the import the way the module exports

Default export: import slugify from "./slugify.js" (any local name works). Named export: import { formatPrice } from "./format.js".

page.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
import slugify from "./slugify.js";
import { formatPrice } from "./format.js";

export const url = `/products/${slugify("Cotton tee")}?p=${formatPrice(1999)}`;
Each import written the way the module exports.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": []
  },
  "include": ["*.js"]
}

Gotchas

  • The TS2613 message names the module by its resolved path without the extension (tsc prints the full path; on this site examples live at /project), so its suggested import is not a path to copy. Keep your original specifier.
  • Importing a CommonJS package's default export is a different question, governed by esModuleInterop; see TS1259.

Sources

Last reviewed 20 October 2026.