Troubleshooting
Common issues and solutions when working with your portfolio website
Troubleshooting
Common issues and their solutions when working with your portfolio website.
Content Not Appearing
Issue: Document not showing in sidebar
Solutions:
- Check that the file is in the correct directory (
content/docs/orcontent/blog/) - Verify frontmatter is correct (YAML format with proper indentation)
- Restart the dev server:
yarn dev - Check for syntax errors in MDX files
- Ensure the file has a
.mdxextension - Make sure That added Document or section is well mentioned in the
docs-order-configs.ts(check Documentation ordering system)
Issue: Changes not reflecting
Solutions:
- Hard refresh your browser (Ctrl+Shift+R or Cmd+Shift+R)
- Clear the
.nextcache:rm -rf .next - Restart the dev server
- Check for build errors:
yarn build
Build Errors
Issue: TypeScript errors
Solutions:
- Run
yarn buildto see all errors - Check for missing imports
- Verify all TypeScript types are correct
- Check MDX syntax (proper closing of code blocks, etc.)
Issue: Contentlayer errors
Solutions:
- Verify frontmatter format is correct
- Check for invalid YAML syntax
- Ensure all required fields are present
- Check file paths are correct
Styling Issues
Issue: Styles not applying
Solutions:
- Clear
.nextcache:rm -rf .next - Rebuild:
yarn build - Check Tailwind classes are correct
- Verify
globals.cssis imported inlayout.tsx
Issue: Dark mode not working
Solutions:
- Check
ThemeProvideris inlayout.tsx - Verify
next-themesis installed - Check browser console for errors
- Ensure theme toggle component is present
Component Issues
Issue: Callouts not displaying
Solutions:
- Check the component is imported in
mdx-components.tsx - Verify the syntax:
<Callout type="info">...</Callout> - Check for proper closing tags
- Ensure the type is valid:
info,success,warning,error,note,danger
Issue: Excalidraw diagrams not loading
Solutions:
- Verify the file path is correct (relative to
public/) - Check the file exists in
public/assets/docs/ - Ensure the file is valid JSON
- Check browser console for errors
- Verify
@excalidraw/excalidrawis installed
Issue: Code blocks not highlighting
Solutions:
- Check the language is specified:
```bash - Verify the language is supported
- Check
shikiis installed - Ensure code block component is in
mdx-components.tsx
Search Issues
Issue: Search not working
Solutions:
- Check
DocsSearchBarcomponent is in navigation - Verify docs are being passed to the component
- Check browser console for errors
- Ensure search modal is rendering correctly
Navigation Issues
Issue: Sidebar not showing
Solutions:
- Check
DocsSidebarcomponent is in the page - Verify docs are being passed correctly
- Check for JavaScript errors in console
- Ensure the component is not hidden on mobile (it's hidden by default on small screens)
Issue: Links not working
Solutions:
- Verify URLs are correct (start with
/docs/or/blog/) - Check the file exists at that path
- Ensure frontmatter is correct
- Check for typos in URLs
Deployment Issues
Issue: Build fails on deployment
Solutions:
- Check build logs for errors
- Verify all dependencies are in
package.json - Check Node.js version matches (20.19.4)
- Ensure environment variables are set
- Check for missing files or assets
Issue: Static generation errors
Solutions:
- Check
generateStaticParamsfunctions - Verify all content files are valid
- Check for missing required fields
- Ensure all paths are correct
Performance Issues
Issue: Slow page loads
Solutions:
- Optimize images (compress, use appropriate formats)
- Check for large dependencies
- Enable Next.js optimizations
- Use static generation where possible
- Check bundle size:
yarn build
Getting More Help
If you're still experiencing issues:
- Check the Next.js Documentation
- Check the Contentlayer Documentation
- Review the Guide Overview for examples
- Check existing content files for reference
- Review browser console for errors
Common Mistakes
- Missing frontmatter: Every file needs frontmatter
- Incorrect YAML syntax: Use proper indentation
- Wrong file location: Files must be in
content/docs/orcontent/blog/ - Invalid MDX syntax: Check for unclosed tags or code blocks
- Missing dependencies: Run
yarn installafter adding new packages
Still Need Help?
If you've tried all the solutions above and still have issues:
- Check the error messages carefully
- Review the relevant section in this guide
- Look at working examples in existing content
- Check the component source code for usage examples