|
| 1 | +# Troubleshooting |
| 2 | + |
| 3 | +This guide covers common issues you may encounter when using the typedoc-plugin-markdown, along with solutions and explanations. |
| 4 | + |
| 5 | +## TypeDoc Loaded Multiple Times |
| 6 | + |
| 7 | +**Symptom:** |
| 8 | + |
| 9 | +You're running TypeDoc and see the following error which is preventing docs from being generated: |
| 10 | + |
| 11 | +> **[warning] TypeDoc has been loaded multiple times. This is commonly caused by plugins which have their own installation of TypeDoc.** |
| 12 | +
|
| 13 | +**Why?**: |
| 14 | + |
| 15 | +This plugin declares TypeDoc as a peer dependency, so it won't install TypeDoc automatically. |
| 16 | + |
| 17 | +If you're running TypeDoc in a standard setup and you're seeing this warning, your package manager is likely resolving dependencies in a way that causes multiple instances of TypeDoc to be loaded. |
| 18 | + |
| 19 | +When installing globally, be aware of [npm/cli#7057](https://github.com/npm/cli/issues/7057). |
| 20 | + |
| 21 | +**Solution:** |
| 22 | + |
| 23 | +Use the `--legacy-peer-deps` flag when installing packages. |
| 24 | + |
| 25 | +## `packageOptions` Not Working |
| 26 | + |
| 27 | +**Symptom:** |
| 28 | + |
| 29 | +You are setting options inside `packageOptions`, but they are being ignored. |
| 30 | + |
| 31 | +**Why?** |
| 32 | + |
| 33 | +The `packageOptions` field only applies to conversion options. Options exposed by this plugin apply during rendering, not conversion. That's why they won't work if placed inside `packageOptions`. |
| 34 | + |
| 35 | +**Solution:** |
| 36 | + |
| 37 | +Place all plugin specific options at the root level of your TypeDoc configuration. |
| 38 | + |
| 39 | +See [TypeDoc packageOptions](https://typedoc.org/documents/Options.Package_Options.html). |
| 40 | + |
| 41 | +## MDX Compilation Failed |
| 42 | + |
| 43 | +**Symptom:** |
| 44 | + |
| 45 | +You're using an MDX parser and see this error (or similar): |
| 46 | + |
| 47 | +> **Error: MDX compilation failed** |
| 48 | +> |
| 49 | +> Cause: Could not parse expression with acorn |
| 50 | +
|
| 51 | +**Why?** |
| 52 | + |
| 53 | +This is almost certainly caused by invalid MDX syntax in doc comments. |
| 54 | + |
| 55 | +**Solution:** |
| 56 | + |
| 57 | +- Wrap invalid MDX in backticks to treat it as a code block. |
| 58 | +- Enable <OptionLink type="utility" name="sanitizeComments" /> to automatically escape problematic characters. |
| 59 | +- Switch to CommonMark, if supported by your parser. |
0 commit comments