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

Incompatibility with docusaurus Rspack experimental options #158

Open
rbala19 opened this issue Dec 2, 2024 · 1 comment
Open

Incompatibility with docusaurus Rspack experimental options #158

rbala19 opened this issue Dec 2, 2024 · 1 comment

Comments

@rbala19
Copy link

rbala19 commented Dec 2, 2024

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
@slorber
Copy link

slorber commented Dec 5, 2024

Answered here: facebook/docusaurus#10741 (comment)

I doubt it's a problem in this plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants