typedoc2md/typedoc-plugin-markdown

`addTranslation` undefined error

Closed this issue · 2 comments

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.

  • To ask question, let me briefly explain about the background,
    I am trying to fix this issue which requires update the version of docusaurus-plugin-typedoc. The project used to have 0.5.0 version, and I change the version into 1.0.5 based on this change log.

  • As you can see from the change log, they mentioned that
    "frontmatter option has been removed. Please use typedoc-plugin-frontmatter."
    Therefore, I used typedoc-plugin-frontmatter.

  • When I updated the code, I encountered this error:

[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.

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.

@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!