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

Sidebar item type docsSidebar throws error when featured as item in sidebar type dropdown #6634

Closed
2 of 7 tasks
mongodben opened this issue Feb 7, 2022 · 1 comment
Closed
2 of 7 tasks
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: duplicate This issue or pull request already exists in another issue or pull request

Comments

@mongodben
Copy link

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

When creating the site's top navigation i want to create a drop down menu where the items are of navitem type docSidebar. however, when i try to include these, the site throws the error:

[ERROR] ValidationError: Bad navbar item type docSidebar

Steps to reproduce

  1. create sidebars in sidebars.js file
  2. in the docusaurus.config.js file, add a navbar.items entry with type: "dropdown".
  3. run npm start in local dev
  4. view error

here is an example sidebar config that'd throw this error:

({
      navbar: {
        title: "MongoDB Realm Docs",
        logo: {
          alt: "Realm Logo",
          src: "img/realm-logo.png",
        },
        items: [
          {
            type: "dropdown",
            label: "SDKs",
            position: "left",
            items: [
              {
                type: "docSidebar",
                position: "left",
                sidebarId: "flutter",
                label: "Alpha",
              },
              {
                type: "docSidebar",
                position: "left",
                sidebarId: "flutter2",
                label: "Beta",
              },
            ],
          },

          {
            href: "https://github.com/mongodben/flutter-sdk-docs",
            label: "GitHub",
            position: "right",
          },
        ],
      },
     // ... more config
})

Expected behavior

no error thrown

Actual behavior

throws errors:

[ERROR] A validation error occurred.
[INFO] The validation system was added recently to Docusaurus as an attempt to avoid user configuration errors.
We may have made some mistakes.
If you think your configuration is valid and should keep working, please open a bug report.
[ERROR] ValidationError: Bad navbar item type docSidebar

Your environment

  • Public source code:
  • Public site URL:
  • Docusaurus version used:
  • Environment name and version (e.g. Chrome 89, Node.js 16.4):
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS):

Reproducible demo

No response

Self-service

  • I'd be willing to fix this bug myself.
@mongodben mongodben added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Feb 7, 2022
@Josh-Cena Josh-Cena added closed: duplicate This issue or pull request already exists in another issue or pull request and removed status: needs triage This issue has not been triaged by maintainers labels Feb 8, 2022
@Josh-Cena
Copy link
Collaborator

Duplicate of #6597 and fixed in #6599

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: duplicate This issue or pull request already exists in another issue or pull request
Projects
None yet
Development

No branches or pull requests

2 participants