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

[Bug]: rootDir assumes --options is used and config file is in project root #525

Open
pjeby opened this issue Dec 25, 2023 · 1 comment
Open
Labels
bug Something isn't working triage

Comments

@pjeby
Copy link

pjeby commented Dec 25, 2023

Plugin

@knodes/typedoc-pluginutils

Typedoc plugin(s) version(s)

@knodes/typedoc-pluginutils@0.23.4, @knodes/typedoc-plugin-pages@0.23.4

Typedoc version

0.25.4

Describe the problem

The rootDir calculation in ABasePlugin makes two invalid assumptions that result in errors in some projects.

First, if --options has been specified, but the options file is in a subdirectory of the project, the selected root directory is incorrect.

Second, if --options has not been specified as a command-line argument, it tries to statSync(undefined) (in rootDir from utils/misc.js).

What did you expected ?

The rootDir to be calculated independently of --options and without throwing an error.

@pjeby pjeby added bug Something isn't working triage labels Dec 25, 2023
@pjeby
Copy link
Author

pjeby commented Dec 26, 2023

A workaround for anyone experiencing this issue: you can add "options": "package.json", (or some other file in your project root) to your config file. Typedoc will ignore it since it'll have already loaded the options when it sees it, but pluginutils and the pages plugin will see what they're looking for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

1 participant