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

Error: The docs folder does not exist when the out folder does not exists #641

Closed
axel7083 opened this issue Jul 1, 2024 · 2 comments
Closed
Labels
bug Issue raised as a bug.

Comments

@axel7083
Copy link
Contributor

axel7083 commented Jul 1, 2024

What package is the bug related to?

typedoc-plugin-markdown

Describe the issue

Our pipeline started failing when migrating from 0.25.13 to 0.26.3 so I tried locally to update to typedoc-plugin-markdown version 4.1.X as recommended in the compatibility matrix https://typedoc-plugin-markdown.org/docs/versioning#compatibility-table.

However when the api folder, where the markdown should be generated does not exist (folder not created before running docusaurus build we are getting the following error

$ docusaurus build
[INFO] [en] Creating an optimized production build...

[ERROR] Error: Unable to build website for locale en.
    at tryToBuildLocale (~\podman-desktop\node_modules\@docusaurus\core\lib\commands\build.js:54:19)
    at async ~\node_modules\@docusaurus\core\lib\commands\build.js:65:9
    at async mapAsyncSequential (~\podman-desktop\node_modules\@docusaurus\utils\lib\jsUtils.js:20:24)
    at async Command.build (~\podman-desktop\node_modules\@docusaurus\core\lib\commands\build.js:63:5) {
  [cause]: Error: The docs folder does not exist for version "current". A docs folder is expected to be found at api.

This can be fixed by making mkdir api && docusaurus build but this seems to be a regression as we were not needed this before

TypeDoc configuration

[
      'docusaurus-plugin-typedoc',
      {
        id: 'api',
        plugin: ['typedoc-plugin-markdown'],
        entryPoints: [resolve('../packages/extension-api/src/extension-api.d.ts')],
        out: 'api',
        hideBreadcrumbs: true,
        readme: 'none',
        tsconfig: resolve('../packages/extension-api/tsconfig.json'),
        hideGenerator: true,
      },
    ],

Expected behavior

The out folder should be created by the plugin before docusaurus get mad that it does not exists

@tgreyuk
Copy link
Member

tgreyuk commented Jul 1, 2024

This has been caused by some updates in TypeDoc 0.26 causing the lifecycle to run before TypeDoc has finished generating files. To fix for now the directory will be created if it doesn't exist. Available in docusaurus-plugin-typedoc@1.0.2

@axel7083
Copy link
Contributor Author

axel7083 commented Jul 2, 2024

Fixes the issue 👍

@axel7083 axel7083 closed this as completed Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue raised as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants