The section Add a Version Dropdown in the Tutorial needs more explanation. It needs to be stressed that the changes to make to the docusaurus.config.js file that are described in this file should be made at a specific point in the file i.e. at the end of the items array of objects and NOT at the beginning as implied by the example.
In other words, the items array in the docusaurus.config.js file should look like this:
navbar: {
title: 'My Site',
logo: {
alt: 'My Site Logo',
src: 'img/logo.svg',
},
items: [
{
type: 'doc',
docId: 'intro',
position: 'left',
label: 'Tutorial',
},
{to: '/blog', label: 'Blog', position: 'left'},
{
label: 'GitHub',
position: 'right',
},
{
type: 'docsVersionDropdown',
},
],
},
When you modify the type: 'doc' field in the example to type: 'docsVersionDropdown' in the docusaurus.config.js field, the web site crashes with the message:
A validation error occurred.
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.
This problem persisted even after the change to docusaurus.config.js was reverted. I had to overwrite the docusaurus.config.js file with a fresh copy to be able to restart the web site.