webdoc-labs / webdoc

Documentation generator for the web
https://www.webdoclabs.com
Other
79 stars 9 forks source link

crashes when doesn't have @memberof on a class #103

Closed stepancar closed 3 years ago

stepancar commented 3 years ago

Hello, I faced with this issue

Rendering template: /project/node_modules/@pixi/webdoc-template/tmpl/method.tmpl
Rendering template: /project/node_modules/@pixi/webdoc-template/tmpl/container.tmpl
(node:29059) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'cssClass' of null
    at LinkerPluginImpl.linkTo (/project/node_modules/@pixi/webdoc-template/node_modules/@webdoc/template-library/lib/template-plugins/LinkerPlugin.js:147:35)
    at TemplateRenderer.eval (lodash.templateSources[5]:60:16)
    at TemplateRenderer.partial (/project/node_modules/@pixi/webdoc-template/node_modules/@webdoc/template-library/lib/TemplateRenderer.js:128:38)
    at eval (lodash.templateSources[0]:295:16)
    at Array.forEach (<anonymous>)
    at eval (lodash.templateSources[0]:293:11)
    at Array.forEach (<anonymous>)
    at TemplateRenderer.eval (lodash.templateSources[0]:13:10)
    at TemplateRenderer.partial (/project/node_modules/@pixi/webdoc-template/node_modules/@webdoc/template-library/lib/TemplateRenderer.js:128:38)

If I add @memberof to class it is working

Also I'm not sure that problem relates to @memberof only. Because I'm converting to webdoc very big project and fix error step by step

ShukantPal commented 3 years ago

That's very weird. @pixi/webdoc-template's method.tmpl file doesn't seem to reference the third argument of LinkerPluginImpl.linkTo. I can add an extra guard against null there.