Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeDoc error: ts.isIdentifierOrPrivateIdentifier is not a function #1240

Closed
1 task done
Alon-L opened this issue Mar 21, 2020 · 11 comments · Fixed by dbartholomae/redux-dynamic-modules-beacon#25 or gpicron/ssb-subjective-group#1
Labels
no bug This is expected behavior

Comments

@Alon-L
Copy link

Alon-L commented Mar 21, 2020

Expected Behavior

TypeDoc should generate new documentation for the files in the src directory.

Actual Behavior

TypeDoc throws an error saying:

E:\Coding\nodejs\bot-generator>typedoc --out docs src

Using TypeScript 3.7.4 from E:\Coding\nodejs\bot-generator\node_modules\typescript\lib
E:\Coding\nodejs\bot-generator\node_modules\typedoc\dist\lib\converter\context.js:194
    return node['name'] && (ts.isIdentifierOrPrivateIdentifier(node['name']) ||
                               ^

TypeError: ts.isIdentifierOrPrivateIdentifier is not a function
    at isNamedNode (E:\Coding\nodejs\bot-generator\node_modules\typedoc\dist\lib\converter\context.
js:194:32)
    at Context.getSymbolAtLocation (E:\Coding\nodejs\bot-generator\node_modules\typedoc\dist\lib\co
nverter\context.js:47:24)
    at Object.createDeclaration (E:\Coding\nodejs\bot-generator\node_modules\typedoc\dist\lib\conve
rter\factories\declaration.js:61:32)
    at ClassConverter.convert (E:\Coding\nodejs\bot-generator\node_modules\typedoc\dist\lib\convert
er\nodes\class.js:28:34)
    at Converter.convertNode (E:\Coding\nodejs\bot-generator\node_modules\typedoc\dist\lib\converte
r\converter.js:116:53)
    at E:\Coding\nodejs\bot-generator\node_modules\typedoc\dist\lib\converter\nodes\block.js:58:32
    at Array.forEach (<anonymous>)
    at BlockConverter.convertStatements (E:\Coding\nodejs\bot-generator\node_modules\typedoc\dist\l
ib\converter\nodes\block.js:56:29)
    at E:\Coding\nodejs\bot-generator\node_modules\typedoc\dist\lib\converter\nodes\block.js:43:26
    at Context.withScope (E:\Coding\nodejs\bot-generator\node_modules\typedoc\dist\lib\converter\co
ntext.js:108:9)

Steps to reproduce the bug

  • Install TypeDoc using either local or global installation npm install typedoc --save-dev or npm install typedoc --global (I tried both of them).
  • Run typedoc --out docs src (I also tried using a config file, which led to the same error)

Environment

  • Typedoc version: 0.17.1
  • Node.js version: v12.12.0
  • OS: Windows 10 1903
@Alon-L Alon-L added the bug Functionality does not match expectation label Mar 21, 2020
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 21, 2020

TypeScript 3.7.4

This is your issue. You ignored the warning about incompatible peer dependencies. You'll need to use an older version of TypeDoc or install a newer version of TypeScript for your project.

warning " > typedoc@0.17.1" has incorrect peer dependency "typescript@>=3.8.3".

@Gerrit0 Gerrit0 added no bug This is expected behavior and removed bug Functionality does not match expectation labels Mar 21, 2020
@Alon-L
Copy link
Author

Alon-L commented Mar 21, 2020

Okay I updated to the latest typescript version and now I'm getting this error:

E:\Coding\nodejs\bot-generator>typedoc --out docs src

Using TypeScript 3.8.3 from E:\Coding\nodejs\bot-generator\node_modules\typescript\lib
Rendering [----------------------------------------] 0%E:\Coding\nodejs\bot-generator\node_modules\
marked\src\marked.js:111
    throw e;
    ^

TypeError: this.renderer.html is not a function
Please report this to https://github.com/markedjs/marked.
    at InlineLexer.output (E:\Coding\nodejs\bot-generator\node_modules\marked\src\InlineLexer.js:85
:30)
    at Parser.tok (E:\Coding\nodejs\bot-generator\node_modules\marked\src\Parser.js:97:36)
    at Parser.parse (E:\Coding\nodejs\bot-generator\node_modules\marked\src\Parser.js:47:19)
    at Function.parse (E:\Coding\nodejs\bot-generator\node_modules\marked\src\Parser.js:30:19)
    at marked (E:\Coding\nodejs\bot-generator\node_modules\marked\src\marked.js:103:19)
    at MarkedPlugin.onParseMarkdown (E:\Coding\nodejs\bot-generator\node_modules\typedoc\dist\lib\o
utput\plugins\MarkedPlugin.js:115:28)
    at E:\Coding\nodejs\bot-generator\node_modules\typedoc\dist\lib\utils\events.js:259:33
    at triggerApi (E:\Coding\nodejs\bot-generator\node_modules\typedoc\dist\lib\utils\events.js:110
:13)
    at Renderer.trigger (E:\Coding\nodejs\bot-generator\node_modules\typedoc\dist\lib\utils\events.
js:252:13)
    at MarkedPlugin.parseMarkdown (E:\Coding\nodejs\bot-generator\node_modules\typedoc\dist\lib\out
put\plugins\MarkedPlugin.js:87:20)

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 21, 2020

Looks like Marked broke in 0.8.1 - markedjs/marked#1621 and since it was a patch version it was automatically pulled in.

Do you have a HTML comment in a heading somewhere? Removing that should fix this until Marked publishes a fix.

@Alon-L
Copy link
Author

Alon-L commented Mar 21, 2020

I couldn't find any HTML comments.
I searched for characters such as - and # but I can't find anything that resembles markdown or HTML.

Edit: Is there anything I'm missing?

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 21, 2020

Hard to say, TypeDoc also reads your README.md file, so if that has HTML in it it might break. I'll publish 0.17.2 shortly pinning marked to 0.8.0 until they fix this issue.

@Alon-L
Copy link
Author

Alon-L commented Mar 21, 2020

After removing all content from README.md it suddenly works.
Thank you for your support.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 21, 2020

0.17.2 published, if you upgrade to that your original readme should work :)

@Alon-L
Copy link
Author

Alon-L commented Mar 21, 2020

Awesome, problem fixed.
Thanks!

@ricardobeat
Copy link

You ignored the warning about incompatible peer dependencies.

@Gerrit0 not necessarily user error. There doesn't seem to be a warning for the peer deps when installing:

✭ yarn add -D typedoc
yarn add v1.16.0
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning " > mini-css-extract-plugin@0.9.0" has unmet peer dependency "webpack@^4.4.0".
warning " > react-loadable-ssr-addon@0.2.0" has unmet peer dependency "webpack@>=4.41.1".
warning "react-pose > popmotion-pose > pose-core > rollup-plugin-typescript2@0.25.2" has unmet peer dependency "rollup@>=1.26.3".
warning " > use-react-router@1.0.7" has unmet peer dependency "react-router@^5.0.0".
warning " > copy-webpack-plugin@5.0.5" has unmet peer dependency "webpack@^4.0.0".
warning " > jest-svg-transformer@1.0.0" has unmet peer dependency "jest@>22".
warning " > raw-loader@3.1.0" has unmet peer dependency "webpack@^4.3.0".
warning " > ts-jest@24.1.0" has unmet peer dependency "jest@>=24 <25".
warning " > workbox-webpack-plugin@4.3.1" has unmet peer dependency "webpack@^2.0.0 || ^3.0.0 || ^4.0.0".
[4/4] 🔨  Building fresh packages...
success Saved 1 new dependency.
info Direct dependencies
└─ typedoc@0.17.7
info All dependencies
└─ typedoc@0.17.7
✨  Done in 12.59s.

Yet it still fails:

✭ yarn typedoc --out api-docs src
yarn run v1.16.0
$ ./frontend/node_modules/.bin/typedoc --out api-docs src

Using TypeScript 3.7.5 from ./frontend/node_modules/typescript/lib
./frontend/node_modules/typedoc/dist/lib/converter/context.js:194
    return node['name'] && (ts.isIdentifierOrPrivateIdentifier(node['name']) ||
                               ^

TypeError: ts.isIdentifierOrPrivateIdentifier is not a function
...

When I add a specific version, or re-install, then it warns:

✭ yarn add -D typedoc@0.17.1
yarn add v1.16.0
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning " > mini-css-extract-plugin@0.9.0" has unmet peer dependency "webpack@^4.4.0".
warning " > react-loadable-ssr-addon@0.2.0" has unmet peer dependency "webpack@>=4.41.1".
warning "react-pose > popmotion-pose > pose-core > rollup-plugin-typescript2@0.25.2" has unmet peer dependency "rollup@>=1.26.3".
warning " > use-react-router@1.0.7" has unmet peer dependency "react-router@^5.0.0".
warning " > copy-webpack-plugin@5.0.5" has unmet peer dependency "webpack@^4.0.0".
warning " > jest-svg-transformer@1.0.0" has unmet peer dependency "jest@>22".
warning " > raw-loader@3.1.0" has unmet peer dependency "webpack@^4.3.0".
warning " > ts-jest@24.1.0" has unmet peer dependency "jest@>=24 <25".
warning " > workbox-webpack-plugin@4.3.1" has unmet peer dependency "webpack@^2.0.0 || ^3.0.0 || ^4.0.0".
warning " > typedoc@0.17.1" has incorrect peer dependency "typescript@>=3.8.3".
[4/4] 🔨  Building fresh packages...
success Saved lockfile.
success Saved 9 new dependencies.
info Direct dependencies
└─ typedoc@0.17.1
info All dependencies
├─ backbone@1.4.0
├─ handlebars@4.7.6
├─ highlight.js@9.18.1
├─ jquery@3.5.1
├─ marked@0.8.2
├─ shelljs@0.8.4
├─ typedoc-default-themes@0.8.0
├─ typedoc@0.17.1
└─ underscore@1.10.2
✨  Done in 13.51s.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented May 19, 2020

That looks like a bug with yarn ^
I'd be open to a PR that adds TS version checking before trying to convert the project to warn the user.

@SaharEbrahimii
Copy link

I have this warning with typedoc :
DeprecationWarning: 'isIdentifierOrPrivateIdentifier' has been deprecated since v4.2.0. Use isMemberName instead.
any idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no bug This is expected behavior
Projects
None yet
4 participants