documentation icon indicating copy to clipboard operation
documentation copied to clipboard

@internal tag crashes documentationjs if indexed type follows

Open bradennapier opened this issue 5 years ago • 1 comments

/** @internal */
export type AnyObj = { [key: string]: any };

this will crash documentation

$ npx documentation readme src/** --readme-file=API.md --section=API --parse-extension ts --shallow --resolve node --config documentation.yaml
TypeError: Cannot read property 'charAt' of undefined
    at Of.inlineCode (/.../node_modules/remark-stringify/lib/visitors/inline-code.js:26:13)

This is an officially supported typescript tag.

Interestingly it only seems to happen when using an indexed object type like the above with the internal tag specifically

bradennapier avatar Aug 05 '20 20:08 bradennapier

I've tried adding this snippet as a testcase, but it doesn't crash the current build of documentation.js. It's possible that the bug is elsewhere in the system, triggered by different code. Can you try and narrow this down, to check that this is in fact the particular code that triggers a crash?

tmcw avatar Nov 14 '20 21:11 tmcw