Migration Guide
This guide will help you migrate your VitePress site from v1.x to v2.x (currently in alpha).Overview
VitePress v2.0 brings significant improvements including Vite 7 support, Shiki v3 integration, and performance enhancements. While most changes are backwards compatible, there are several breaking changes to be aware of.Breaking Changes
New Features
Take advantage of these new features in v2:Vite 7 Performance
Faster build times and improved development experience with Vite 7.
Shiki v3 Highlighting
Better syntax highlighting with lazy-loaded languages and improved performance.
Async Markdown Rendering
More powerful markdown processing with async support.
Enhanced DocSearch
DocSearch v4 with sidepanel and AI-powered search (beta).
CJK-Friendly Emphasis
Enabled by default for better CJK language support:Distributed Config Files
Support for multiple config files across your project:Custom Display Names for Code Blocks
Testing Your Migration
Troubleshooting
Type errors with third-party Vite plugins
Type errors with third-party Vite plugins
Vite 7 may cause type mismatches with some plugins. Solutions:Or suppress with
as any and report to plugin repository.Custom CSS not applying to code blocks
Custom CSS not applying to code blocks
If your code block styles aren’t working:
- Replace
.vp-codewith.shiki - Check for
vp-adaptive-themeclass usage - Use
pre.shikior[class*='language-'] preselectors
Search styles broken after upgrade
Search styles broken after upgrade
DocSearch v4 changed class names and structure:
- Review custom DocSearch CSS
- Update selectors for navbar search button
- Update modal styles
- Test on mobile viewports
Build fails with 'markdown.render is not a function'
Build fails with 'markdown.render is not a function'
This happens with custom content renderers:
Rollback Instructions
If you need to rollback to v1.x:Getting Help
- Documentation: vitepress.dev
- GitHub Issues: vuejs/vitepress/issues
- Discord: chat.vuejs.org
- Changelog: CHANGELOG.md
For the latest breaking changes and migration notes, always check the official changelog.