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

addTranslation undefined error #705

Closed
inhwaS opened this issue Oct 24, 2024 · 2 comments
Closed

addTranslation undefined error #705

inhwaS opened this issue Oct 24, 2024 · 2 comments
Labels
answered Question has been answered. question

Comments

@inhwaS
Copy link

inhwaS commented Oct 24, 2024

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.

@tgreyuk
Copy link
Member

tgreyuk commented Oct 25, 2024

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
Copy link
Author

inhwaS commented Oct 25, 2024

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

@tgreyuk tgreyuk closed this as completed Nov 1, 2024
@tgreyuk tgreyuk added the answered Question has been answered. label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered Question has been answered. question
Projects
None yet
Development

No branches or pull requests

2 participants