Typedoc: Support TypeScript 3.4

Created on 16 Apr 2019  路  5Comments  路  Source: TypeStrong/typedoc

Problem

My app code uses globalThis, which is a new feature in TypeScript 3.4. Unfortunately, typedoc is using an old version of TS which doesn't know about it, and it breaks on my project.

Using TypeScript 3.2.4 from C:\ProgramData\Jenkins\workspace\atlas-dev-api\node_modules\typedoc\node_modules\typescript\lib
Error: C:/ProgramData/Jenkins/workspace/atlas-dev-api/src/step-identity.ts(12)
 Cannot find name 'globalThis'.

Suggested Solution

Upgrade TypeDoc to use the latest version of TypeScript.

Most helpful comment

I'm also affected by a 3.4 issue that is described here:
https://github.com/Microsoft/TypeScript/issues/30153

Since master has already been version bumped to 3.4, if someone really needs it (like me...) you can do the following:

git clone https://github.com/TypeStrong/typedoc.git
cd typedoc
npm install

Then, generate the docs:

./bin/typedoc <path-to-your-project>

All 5 comments

The fix for this has already been merged ~2 weeks ago: https://github.com/TypeStrong/typedoc/pull/1014

We just need to ask maintainers about their plan to publish a release.

TypeScript 3.4 const assertions seem not to work yet with the current version (0.15.0-0).

Error: /some-path/some-file.ts(11)
 Cannot find name 'const'.

for source like this

const composites = [ 'list', 'dir' ] as const

I'm also affected by a 3.4 issue that is described here:
https://github.com/Microsoft/TypeScript/issues/30153

Since master has already been version bumped to 3.4, if someone really needs it (like me...) you can do the following:

git clone https://github.com/TypeStrong/typedoc.git
cd typedoc
npm install

Then, generate the docs:

./bin/typedoc <path-to-your-project>

Thanks @fc for the workaround. Does anyone know when the maintainers will publish the release to support 3.4?

This should be closed. Resolved here:
https://github.com/TypeStrong/typedoc/issues/1068

Was this page helpful?
0 / 5 - 0 ratings