You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Crash "Error: Could not set option "pluginPages:pages": Every root pages should set moduleRoot to true, or none" when pages is empty array #165
and when pages property in my pages.config is empty, like that:
{
"pages": [],
"source": "tutorials"
}
This plugin crashes typedoc like that:
$ typedoc src/index.ts --out docs --includeVersion --pluginPages ./pagesconfig.json
Loaded plugin @knodes/typedoc-plugin-pages
TypeDoc exiting with unexpected error:
Error: Could not set option "pluginPages:pages": Every root pages should set `moduleRoot` to true, or none
at /Projects/bottom-line/node_modules/@knodes/typedoc-pluginutils/dist/options/option-group.js:144:31
at /Projects/bottom-line/node_modules/@knodes/typedoc-pluginutils/dist/options/option-group.js:160:34
... 2 lines matching cause stack trace ...
at OptionGroup._setValue (/Projects/bottom-line/node_modules/@knodes/typedoc-pluginutils/dist/options/option-group.js:137:34)
at OptionGroup._setValueFromFile (/Projects/bottom-line/node_modules/@knodes/typedoc-pluginutils/dist/options/option-group.js:118:18)
at OptionGroup._setValue (/Projects/bottom-line/node_modules/@knodes/typedoc-pluginutils/dist/options/option-group.js:133:22)
at /Projects/bottom-line/node_modules/@knodes/typedoc-pluginutils/dist/options/option-group.js:37:22
at /Projects/bottom-line/node_modules/@knodes/typedoc-pluginutils/dist/events-extra.js:69:13
at Options.instance.<computed> (/Projects/bottom-line/node_modules/@knodes/typedoc-pluginutils/dist/events-extra.js:102:29) {
[cause]: AssertionError [ERR_ASSERTION]: Every root pages should set `moduleRoot` to true, or none
at Object.validate (/Projects/bottom-line/node_modules/@knodes/typedoc-plugin-pages/dist/options/build.js:82:30)
at Object.5 (/Projects/bottom-line/node_modules/typedoc/dist/lib/utils/options/declaration.js:146:26)
at convert (/Projects/bottom-line/node_modules/typedoc/dist/lib/utils/options/declaration.js:184:60)
at Options.setValue (/Projects/bottom-line/node_modules/typedoc/dist/lib/utils/options/options.js:167:53)
at Option.setValue (/Projects/bottom-line/node_modules/@knodes/typedoc-pluginutils/dist/options/option.js:56:41)
at /Projects/bottom-line/node_modules/@knodes/typedoc-pluginutils/dist/options/option-group.js:141:27
at /Projects/bottom-line/node_modules/@knodes/typedoc-pluginutils/dist/options/option-group.js:160:34
at Array.map (<anonymous>)
at OptionGroup._mapOptions (/Projects/bottom-line/node_modules/@knodes/typedoc-pluginutils/dist/options/option-group.js:160:14)
at OptionGroup._setValue (/Projects/bottom-line/node_modules/@knodes/typedoc-pluginutils/dist/options/option-group.js:137:34) {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: 0,
expected: 1,
operator: '=='
}
}
error Command failed with exit code 6.
What did you expected ?
I use a template for my libraries, I'm having empty pages array by default, with a plan to add some pages when they are ready (which usually don't happen too early in the stage of creating somthing).
I'd like this plugin just not to inject anything as a page when there is nothing defined and just silently continue the process of building the docs.
Unfortunately no. I'm still working on the next release, and I don't have the bandwidth to checkout and do a hotfix update. When I have time I prefer focus on new features that need to be finished and that will fix this by the way.
Activity
GerkinDev commentedon Aug 22, 2022
This issue has been spotted and is fixed in pending next version. Still working on it.
In the meantime, I suggest you add a placeholder page.
felix-hoc commentedon Sep 28, 2022
Any update on this? 🙏🏼
I'm running into the same issue, and due to a more complex typedoc setup it's not easily possible to add placeholder pages.
GerkinDev commentedon Oct 21, 2022
Unfortunately no. I'm still working on the next release, and I don't have the bandwidth to checkout and do a hotfix update. When I have time I prefer focus on new features that need to be finished and that will fix this by the way.
fix(plugin-pages): do not throw on empty page list
fix(plugin-pages): do not throw on empty page list
fix(plugin-pages): do not throw on empty page list
fix(plugin-pages): do not throw on empty page list (#312)