docusaurus-openapi-docs icon indicating copy to clipboard operation
docusaurus-openapi-docs copied to clipboard

Language Tabs interment crash

Open rhumbertgz opened this issue 1 year ago • 0 comments

Describe the bug

I'm facing a runtime issue when switching from languages tabs. For some languages ( e.g., curl and powershell) it works perfectly, but if I add other languages (e.g., python, go, javascript) it crashes.. I'm using the following four languages:

 languageTabs: [
      {
        highlight: "bash",
        language: "curl",
        logoClass: "bash",
      },
      {
        highlight: "powershell",
        language: "powershell",
        logoClass: "powershell",
      },
      {
        highlight: "javascript",
        language: "nodejs",
        logoClass: "nodejs",
        variant: "axios",
      },
      {
        highlight: "python",
        language: "python",
        logoClass: "python",
        variant: "requests",
      },
    ],

Expected behavior

I added v3.0.0-beta.10 to new project generated with the Docusaurus CLI. I'm using as reference the demo the demo 3.0.0-beta.10 which works fine running on a Codespace. I have checked all my dependencies and are identical to the one on the Demo. I don't see what I'm missing.

Current behavior

I get this error whenever I add any other language than curl and powershell.

Uncaught runtime errors:
×
ERROR
Docusaurus error: The <Tabs> has a defaultValue "requests" but none of its children has the corresponding value. Available values are: restmethod. If you intend to show no default tab, use defaultValue={null} instead.
    at getInitialStateValue (webpack-internal:///./node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@docusaurus/theme-common/lib/utils/tabsUtils.js:24:57)
    at eval (webpack-internal:///./node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@docusaurus/theme-common/lib/utils/tabsUtils.js:26:275)
    at mountState (webpack-internal:///./node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16168:20)
    at Object.useState (webpack-internal:///./node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16881:16)
    at useState (webpack-internal:///./node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:1624:21)
    at useTabs (webpack-internal:///./node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@docusaurus/theme-common/lib/utils/tabsUtils.js:26:270)
    at TabsComponent (webpack-internal:///./node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@t_4supdxkys5nyzwzue2bqmjp7my/node_modules/docusaurus-theme-openapi-docs/lib/theme/ApiExplorer/CodeTabs/index.js:8:369)
    at renderWithHooks (webpack-internal:///./node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:15487:18)
    at mountIndeterminateComponent (webpack-internal:///./node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:20099:13)
    at beginWork (webpack-internal:///./node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:21622:16)
ERROR
Docusaurus error: The <Tabs> has a defaultValue "requests" but none of its children has the corresponding value. Available values are: restmethod. If you intend to show no default tab, use defaultValue={null} instead.
    at getInitialStateValue (webpack-internal:///./node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@docusaurus/theme-common/lib/utils/tabsUtils.js:24:57)
    at eval (webpack-internal:///./node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@docusaurus/theme-common/lib/utils/tabsUtils.js:26:275)
    at mountState (webpack-internal:///./node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16168:20)
    at Object.useState (webpack-internal:///./node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16881:16)
    at useState (webpack-internal:///./node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:1624:21)
    at useTabs (webpack-internal:///./node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@docusaurus/theme-common/lib/utils/tabsUtils.js:26:270)
    at TabsComponent (webpack-internal:///./node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@t_4supdxkys5nyzwzue2bqmjp7my/node_modules/docusaurus-theme-openapi-docs/lib/theme/ApiExplorer/CodeTabs/index.js:8:369)
    at renderWithHooks (webpack-internal:///./node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:15487:18)
    at mountIndeterminateComponent (webpack-internal:///./node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:20099:13)
    at beginWork (webpack-internal:///./node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:21622:16)
ERROR
Docusaurus error: The <Tabs> has a defaultValue "requests" but none of its children has the corresponding value. Available values are: restmethod. If you intend to show no default tab, use defaultValue={null} instead.
    at getInitialStateValue (webpack-internal:///./node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@docusaurus/theme-common/lib/utils/tabsUtils.js:24:57)
    at eval (webpack-internal:///./node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@docusaurus/theme-common/lib/utils/tabsUtils.js:26:275)
    at mountState (webpack-internal:///./node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16168:20)
    at Object.useState (webpack-internal:///./node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:16881:16)
    at useState (webpack-internal:///./node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.development.js:1624:21)
    at useTabs (webpack-internal:///./node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@docusaurus/theme-common/lib/utils/tabsUtils.js:26:270)
    at TabsComponent (webpack-internal:///./node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@t_4supdxkys5nyzwzue2bqmjp7my/node_modules/docusaurus-theme-openapi-docs/lib/theme/ApiExplorer/CodeTabs/index.js:8:369)
    at renderWithHooks (webpack-internal:///./node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:15487:18)
    at mountIndeterminateComponent (webpack-internal:///./node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:20099:13)
    at beginWork (webpack-internal:///./node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.development.js:21622:16)

My Environment

  • Version used: 3.0.0-beta.10
  • Environment name and version: node.js v20.12.2, Safari 17.4.1 (19618.1.15.11.14), Edge Version 124.0.2478.105, Chrome Version 124.0.6367.209.
  • Operating System and version (desktop or mobile): MacOS 14.4.1 (23E224) & Linux Dev Container
  • Package Manager: NPM & PNPM

rhumbertgz avatar May 21 '24 17:05 rhumbertgz