Troubleshooting
Common issues and solutions for EmberDocs.
Build Issues
Error: Cannot find module 'flexsearch'
Solution: Install the missing dependency:
bash
npm install flexsearch
npm install --save-dev @types/flexsearchError: Document path not found
Issue: Your markdown files are not being discovered.
Solution:
- Check file paths are correct
- Ensure files have
.mdextension - Verify frontmatter is valid YAML
Build timeout
Solution: Increase build timeout in next.config.js:
javascript
export default {
staticPageGenerationTimeout: 300, // seconds
};Search Issues
Search returns no results
- Check that search index was built:
npm run build:search - Verify
public/search-index.jsonexists - Ensure documents have proper frontmatter
Search is slow
Solution:
- Reduce
maxBodyWordsin search config - Limit number of documents indexed
- Use search debouncing
Theme/Styling
Dark mode not working
- Check
data-themeattribute:javascriptconsole.log(document.documentElement.getAttribute('data-theme')); - Verify CSS variables are set
- Clear browser cache
Fonts not loading
Solution:
- Check Google Fonts links in
layout.tsx - Verify network requests in browser DevTools
- Check
font-familyin CSS
Navigation Issues
Breadcrumbs not showing
Solution:
- Ensure document slug matches file path
- Check that navigation structure is generated
- Verify
getBreadcrumbs()function
TOC not updating on scroll
Solution:
- Check IntersectionObserver browser support
- Verify headings have ID attributes
- Ensure JavaScript is enabled
Performance
Page loads slowly
Solutions:
- Optimize images with Next.js Image
- Enable code splitting with
dynamic() - Use
@next/bundle-analyzerfor bundle size analysis (install separately if needed)
Search is laggy
Solution:
- Debounce search queries
- Reduce search result count
- Implement virtual scrolling for results
Development Server
Port already in use
bash
npm run dev -- -p 3001Hot reload not working
bash
# Clear cache and restart
rm -rf .next
npm run devTypeScript errors
bash
# Type check
npm run typecheck
# Clear TypeScript cache
rm -rf .next
npm run typecheckDeployment
Build fails on deploy
- Check Node.js version matches locally
- Clear build cache
- Check environment variables
Assets not loading
Ensure assets are in public/ directory and referenced correctly:
markdown
Browser Compatibility
EmberDocs supports:
- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
For older browsers, use a transpiler.
Getting Help
If issues persist:
- Check GitHub Issues
- Create a minimal reproduction
- Include:
- Node.js version
- EmberDocs version
- Steps to reproduce
- Error message/screenshot