-
Notifications
You must be signed in to change notification settings - Fork 34
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
AssertionError: "Tried to access Context.program when not converting a source file." #587
Comments
Except hold typedoc-plugin-external-module-name to 3.1.0, due to christopherthielen/typedoc-plugin-external-module-name#587
I suspect this problem may have arisen with typedoc 0.20.0, which I believe changed around the converters. Earlier versions of typedoc aren't compatible with typescript 4.1.x, so I didn't explore back further to confirm. |
FWIW - this plugin is likely partially obsolete with 0.20. This plugin lets you emulate library mode by manually grouping reflections into modules via The one rather big place where this plugin is still necessary is when dealing with merging modules - I'm not sure many packages will need to do this, but typedoc doesn't do it. |
@Gerrit0 Is this documented somewhere? I'm trying to figure out how to fix my "Class default" everywhere and haven't been able to. Any help would be appreciated. |
It is mentioned in the 0.20 release notes - https://github.com/TypeStrong/typedoc/releases/tag/v0.20.0
In 0.20, TypeDoc documents your library as it appears to the user. If you default export something, then it is exported as The obvious fix to this is to stop using default exports.... which I support wholeheartedly. You could also offer both default exports and named exports, at which point TypeDoc will use the definition order to determine the name: class X {}
export { X }
export default X Will result in However, if you are seeing this in a bunch of places, this probably means you are giving TypeDoc more than one entry point. Chances are, you should only be giving TypeDoc your top level entry point, |
I pushed a branch https://github.com/christopherthielen/typedoc-plugin-external-module-name/tree/typedoc-0.20-compat that handles multiple programs, but I haven't determined if it is otherwise compatible with typedoc 0.20.x |
@christopherthielen @Gerrit0 this plugin is still very relevant. I would prefer not to manually add |
FWIW, I downgraded to typedoc 0.19.2 and the issues are gone. I'll just do that for now since I'm not using anything in ^0.20.1 at the moment. |
Hello, I ran into the same problem after typedoc update. And it seems the compat branch is broken. We used the plugin because of it merging behaviour of same @module in different files and the separation of dots in the module name for navigation. For now we also stay on 0.19 with 0.4.5. |
In 4.0.0 and beyond, I get this error, on my template project that only has a single.ts trivial file and a couple README.md files.
It works in 3.1.0
Typedoc: 0.20.4
Typescript: 4.1.3
The text was updated successfully, but these errors were encountered: