Skip to content

ts.isIdentifierOrPrivateIdentifier is not a function #1257

@Gerrit0

Description

@Gerrit0

TypeDoc 0.17 moves TypeScript from a direct dependency to a peer dependency.

This means that when you npm i typedoc, TypeDoc will use the TypeScript version from your project instead of bundling its own. This has some advantages.

  1. You can upgrade TS and use new features even if TypeDoc doesn't support them yet.
  2. TypeDoc's bundle size drops to a third of its previous size - https://bundlephobia.com/result?p=typedoc@0.17.3

However, this means that if you use a version of TypeScript which is incompatible with TypeDoc, you will likely experience crashes. TypeDoc specifies the versions of TypeScript that it expects to be compatible with.

typedoc/package.json

Lines 33 to 35 in c296503

"peerDependencies": {
"typescript": ">=3.8.3"
},

However, if you install an older version of TypeScript, most package managers won't refuse to install the latest TypeDoc, they will give you a warning, but lots of people ignore warnings.

> npm i typescript@3.6.x typedoc@0.17.x
npm WARN typedoc@0.17.3 requires a peer of typescript@>=3.8.3 but none is installed. You must install peer dependencies
yourself.

If you are experiencing crashes when using the latest TypeDoc you have two options.

  1. Upgrade your project's TypeScript to a newer version.
  2. Use an older TypeDoc version

I was surprised by how many people have noted that the latest TypeDoc breaks on their system... so I decided this should be a good issue to pin for a couple weeks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions