docusaurus-plugin-typedoc-api icon indicating copy to clipboard operation
docusaurus-plugin-typedoc-api copied to clipboard

Incompatibility with docusaurus Rspack experimental options

Open rbala19 opened this issue 11 months ago • 1 comments

Docusaurus version: 3.6.1 (Latest Major and minor version) Docusaurus-plugin-openapi-docs version: 4.0.1 (Latest Version)

When I enable docusaurus-plugin-typedoc-api in my themes config and turn on rspackBundle in docusaurus's new experimental config (available for versions > 3.6), I run into a webpack error during asset bundling. Either turning off rspackBundle or commenting out the open api theme plugin fixes the build. As the experimental option is a relatively new one on docusaurus (as of the last couple of months), I'm assuming there is a bit of catch up to do with peripheral docusaurus plugins. Is support of turning both options at the same time planned at some point in the future?

In docusaurus.config.js:

 future: {
    experimental_faster: {
      swcJsLoader: false 
      swcJsMinimizer: true,
      swcHtmlMinimizer: true,
      lightningCssMinimizer: true,
      rspackBundler: true, //Setting to false fixes the build
      mdxCrossCompilerCache: true,
    },
  },

In docusaurus.config.js:

  themes: [
    '@docusaurus/theme-mermaid',
    'docusaurus-theme-openapi-docs', 
  ],
};

On Running docusaurus build

[ERROR] Error: Unable to build website for locale en.
    at tryToBuildLocale (/Users/rahulb/Desktop/front/doc_site/node_modules/@docusaurus/core/lib/commands/build/build.js:78:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /Users/rahulb/Desktop/front/doc_site/node_modules/@docusaurus/core/lib/commands/build/build.js:34:9
    at async mapAsyncSequential (/Users/rahulb/Desktop/front/doc_site/node_modules/@docusaurus/utils/lib/jsUtils.js:21:24)
    at async Command.build (/Users/rahulb/Desktop/front/doc_site/node_modules/@docusaurus/core/lib/commands/build/build.js:33:5) {
  [cause]: [Error:   × TypeError: Cannot read properties of undefined (reading 'set')
    │     at Object.fn (/Users/rahulb/Desktop/front/doc_site/node_modules/webpack/lib/ProvidePlugin.js:43:37)
    │     at SyncHook.callAsyncStageRange (/Users/rahulb/Desktop/front/doc_site/node_modules/@rspack/lite-tapable/dist/index.js:240:21)
    │     at SyncHook.callStageRange (/Users/rahulb/Desktop/front/doc_site/node_modules/@rspack/lite-tapable/dist/index.js:259:14)
    │     at QueriedHook.call (/Users/rahulb/Desktop/front/doc_site/node_modules/@rspack/lite-tapable/dist/index.js:218:26)
    │     at /Users/rahulb/Desktop/front/doc_site/node_modules/@rspack/core/dist/index.js:13679:28
    │     at last.function (/Users/rahulb/Desktop/front/doc_site/node_modules/@rspack/core/dist/index.js:14477:25)
    │
  ] {
    code: 'GenericFailure'
  }
}
[INFO] Docusaurus version: 3.6.1
Node version: v20.11.0

rbala19 avatar Dec 02 '24 21:12 rbala19

Answered here: https://github.com/facebook/docusaurus/discussions/10741#discussioncomment-11472757

I doubt it's a problem in this plugin

slorber avatar Dec 05 '24 12:12 slorber