typedoc2md / typedoc-plugin-markdown

A plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown.
https://typedoc-plugin-markdown.org
MIT License
725 stars 177 forks source link

`addTranslation` undefined error #705

Closed inhwaS closed 3 weeks ago

inhwaS commented 4 weeks ago

What package is your question related to?

typedoc-plugin-frontmatter

What would you like to ask?

Hello, I am Inhwa from Lexical open source project, as MLH fellowship program.

[ERROR] Error: Unable to build website for locale en.
    at tryToBuildLocale (/Users/inhwa.son/lexical/node_modules/@docusaurus/core/lib/commands/build.js:54:19)
    at async /Users/inhwa.son/lexical/node_modules/@docusaurus/core/lib/commands/build.js:65:9
    at async mapAsyncSequential (/Users/inhwa.son/lexical/node_modules/@docusaurus/utils/lib/jsUtils.js:21:24)
    at async Command.build (/Users/inhwa.son/lexical/node_modules/@docusaurus/core/lib/commands/build.js:63:5) {
  [cause]: TypeError: Cannot read properties of undefined (reading 'addTranslations')
      at _classThis.<anonymous> (/Users/inhwa.son/lexical/node_modules/typedoc-plugin-markdown/dist/index.js:94:34)
      at triggerEvents (/Users/inhwa.son/lexical/node_modules/typedoc/dist/lib/utils/events.js:192:43)
      at triggerApi (/Users/inhwa.son/lexical/node_modules/typedoc/dist/lib/utils/events.js:168:13)
      at eventsApi (/Users/inhwa.son/lexical/node_modules/typedoc/dist/lib/utils/events.js:61:18)
      at _classThis.trigger (/Users/inhwa.son/lexical/node_modules/typedoc/dist/lib/utils/events.js:390:13)
      at _classThis.convert (/Users/inhwa.son/lexical/node_modules/typedoc/dist/lib/converter/converter.js:210:18)
      at _classThis.convert (/Users/inhwa.son/lexical/node_modules/typedoc/dist/lib/application.js:296:44)
      at generateTypedoc (/Users/inhwa.son/lexical/node_modules/docusaurus-plugin-typedoc/dist/plugin.js:97:31)
      at async Object.pluginDocusaurus [as plugin] (/Users/inhwa.son/lexical/node_modules/docusaurus-plugin-typedoc/dist/plugin.js:38:9)
      at async initializePlugin (/Users/inhwa.son/lexical/node_modules/@docusaurus/core/lib/server/plugins/init.js:91:32)
}

I see the code that typedoc-plugin-markdown has addTranslations part,.

Based on Lexical codebase, there is some typedoc customization here.

May I ask why I am encountering this error? I would greatly appreciate your guidance on how to resolve this issue.

tgreyuk commented 4 weeks ago

Hi @inhwaS,

Thanks for reaching out. The latest version of typedoc-plugin-markdown has a peer dependency of typedoc@0.26, but I notice the typedoc version on the project is 0.25.12. So the first thing I recommend is to update typedoc to latest 0.26 version. Let me know how you get on.

inhwaS commented 4 weeks ago

@tgreyuk Hello, thank you so much for your response. I tried to do from scratch and updating "typedoc": "^0.26.10" with "docusaurus-plugin-typedoc": "^1.0.5" don't make that error again. I guess I messed up with other updates. I really appreciate your help!