Common issues
Find solutions to the most common issues when using Better SVG.SVG preview panel not showing
SVG preview panel not showing
The SVG Preview panel only appears when you have an SVG file open. Make sure:
- You have a
.svgfile open in the editor - The
betterSvg.autoRevealsetting is enabled (default:true) - The Explorer view is visible in the sidebar
- Close and reopen the SVG file
- Check your VS Code version (requires VS Code 1.85.0 or later)
- Reload the VS Code window (
Ctrl+RorCmd+R)
Preview shows blank or doesn't render correctly
Preview shows blank or doesn't render correctly
If your SVG preview appears blank or renders incorrectly:
- Check SVG syntax: Ensure your SVG file has valid XML syntax
- Try dark mode toggle: Click the dark background toggle if your SVG uses light colors
- Enable grid background: The checkerboard pattern helps visualize transparent areas
- Adjust currentColor: Use the color picker to change the
currentColorvalue - Check zoom level: Try resetting the zoom by clicking multiple times
Hover preview not working in framework files
Hover preview not working in framework files
If hover previews aren’t showing in React, Vue, Svelte, or Astro files:
- Verify the
betterSvg.enableHoversetting istrue(default) - Ensure the file extension is supported (
.jsx,.tsx,.vue,.astro,.svelte) - The SVG must be inline in the code (external file references won’t show hover previews)
- The SVG must have valid opening and closing tags
<svg>) if hovering over the content doesn’t work.Gutter icons not appearing
Gutter icons not appearing
If SVG preview icons aren’t showing next to line numbers:
- Check that
betterSvg.showGutterPreviewis enabled (default:true) - Ensure you’re working with a supported file type
- The extension must detect a complete SVG element in the code
- Try saving the file to trigger a refresh
.jsx, .tsx, .vue, .svelte, and .astro.Optimize SVG button not working
Optimize SVG button not working
Settings not taking effect
Settings not taking effect
If configuration changes aren’t working:
- Open VS Code Settings (
Ctrl+,orCmd+,) - Search for “Better SVG” to see all extension settings
- Make sure you’re editing the correct scope (User vs Workspace)
- Reload the VS Code window after changing settings
defaultColor, ensure you use valid hex format (e.g., #ffffff or #fff).Extension not activating
Extension not activating
Better SVG activates when you open supported file types. If it’s not activating:
- Check that the extension is installed and enabled
- Open a
.svgfile to trigger activation - Verify your VS Code version is 1.85.0 or later
- Check for conflicts with other SVG extensions
- Look for activation errors in the Output panel (select “Better SVG” from the dropdown)
svg, xml, astro, javascriptreact, typescriptreact, svelte, vue, liquid.Zoom and pan controls not responding
Zoom and pan controls not responding
If zoom and pan controls aren’t working in the preview:
- Click to zoom in: Click directly on the SVG preview
- Zoom out: Hold
Altand click - Smooth zoom: Hold
Altand scroll with your mouse wheel - Pan: Click and drag the SVG
Optimization removes important attributes
Optimization removes important attributes
If SVGO optimization removes attributes you need:
- Framework-specific attributes (
v-if,on:click,className, etc.) should be preserved automatically - To keep
classattributes, setbetterSvg.removeClassestofalsein settings - JSX interpolation and spread operators (
{...props}) are preserved
- Adjusting the
betterSvg.removeClassessetting - Using a custom SVGO configuration file in your project (if supported in future versions)
- Manually editing the SVG after optimization
Still having issues?
If you’re experiencing issues not covered here:- Check the GitHub Issues to see if others have reported the same problem
- Review the extension’s changelog for recent changes
- Report a new issue with:
- Your VS Code version
- Better SVG extension version
- Steps to reproduce the problem
- Any error messages from the Developer Console