Sidebar Error `Invalid prop "items"` when creating sidebar inside of themeconfig
See original GitHub issueDescribe the bug
I cannot seem to get the sidebar working properly and get these warnings and errors when attempting to create one:
Reproduction
My .vitepress/config.js
file looks like this right now since I am just starting to write my documentation:
export default {
title: 'Magnetar Docs',
themeConfig: {
nav: [
{
text: 'Changelog',
link: 'https://github.com/CyCraft/magnetar/blob/production/CHANGELOG.md',
},
{ text: 'Github', link: 'https://github.com/cycraft/magnetar' },
],
// sidebar: [{ text: 'About', items: [{ text: 'About', link: '/docs-main/about' }] }],
sidebar: [{ text: 'About', link: '/docs-main/about' }],
},
}
I thought I was using the same syntax as the docs use, but I still get this error.
However, if I use the synax in the commented out code with the items
array, I obviously don’t get the warnings and errors, but then the page looks like this and the second About
route leads to a 404 page. It’s also not how I want my sidebar to look.
Expected behavior
I just want my sidebar to look like it does in my quasar version, but obviously using vitepress. Simple sections with the subsections based on the markdown #, ##, ###'s. I see nothing in the documentation to help me achieve this however.

System Info
System:
OS: macOS 12.5
CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
Memory: 23.31 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.5.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 7.24.2 - /usr/local/bin/npm
Browsers:
Chrome: 104.0.5112.79
Firefox: 90.0.2
Firefox Developer Edition: 97.0
Safari: 15.6
Safari Technology Preview: 16.0
Additional context
My docs file list looks like this
.vitepress/theme/index.js
looks like
import DefaultTheme from 'vitepress/theme'
import './custom.css'
export default DefaultTheme
Perhaps it has to do with this? I doubt that though.
Validations
- Follow our Code of Conduct
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Ah, let’s keep this issue open for now. We need to fix certain things like making text optional or allowing link directly at top level. This was reported on #846 too, but there too the OP closed it, so it went unnoticed.
Awesome! Well thank you for the help and information!