cloud-annotations / docusaurus-openapi

🦕 OpenAPI plugin for generating API reference docs in Docusaurus v2.
https://docusaurus-openapi.netlify.app
MIT License
498 stars 82 forks source link

Error when running with Docusaurus v2.2.0 #222

Closed dabeeeenster closed 1 year ago

dabeeeenster commented 1 year ago

Hi

Upgrading to Docusaurus v2.2.0 I get this:

❯ npm run build

> flagsmith-docs@0.0.0 build
> docusaurus build

[INFO] [en] Creating an optimized production build...
WARNING: Loading a directory of OpenAPI definitions is experimental and subject to unannounced breaking changes.

● Client █████████████████████████ building (11%) 0/1 entries 708/737 dependencies 105/303 modules 74 active
 babel-loader › mdx-loader › docs/guides-and-examples/testing-push-notifications.md

● Server █████████████████████████ building (11%) 0/1 entries 881/947 dependencies 166/413 modules 120 active
 babel-loader › mdx-loader › docs/clients/client-side/android.md

[ERROR] TypeError: Cannot read properties of undefined (reading 'mermaid')
    at Object.mdxLoader (/Users/ben/flagsmith/docs/node_modules/@docusaurus/mdx-loader/lib/loader.js:115:43)
    at LOADER_EXECUTION (/Users/ben/flagsmith/docs/node_modules/loader-runner/lib/LoaderRunner.js:132:14)
    at runSyncOrAsync (/Users/ben/flagsmith/docs/node_modules/loader-runner/lib/LoaderRunner.js:133:4)
    at iterateNormalLoaders (/Users/ben/flagsmith/docs/node_modules/loader-runner/lib/LoaderRunner.js:250:2)
    at /Users/ben/flagsmith/docs/node_modules/loader-runner/lib/LoaderRunner.js:223:4
    at /Users/ben/flagsmith/docs/node_modules/webpack/lib/NormalModule.js:834:15
    at eval (eval at create (/Users/ben/flagsmith/docs/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:12:1)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
    at runNextTicks (node:internal/process/task_queues:65:3)
    at processImmediate (node:internal/timers:437:9)
[INFO] Docusaurus version: 2.2.0
Node version: v16.15.1

The PR we have on this if you want to reproduce is here: https://github.com/Flagsmith/flagsmith-docs/pull/221

sean-perkins commented 1 year ago

I've identified the regression in Docusaurus 2.2.0 that is causing this issue. I've reported that bug here: https://github.com/facebook/docusaurus/issues/8298.

I'll submit two PRs:

Edit:

Just the one PR. Docusaurus is not interested in a change to their source for this undocumented API at this time.

dabeeeenster commented 1 year ago

Confirmed as fixed!