Common Issues
Icons not showing in the viewer
Icons not showing in the viewer
Possible Causes
-
Missing xmlns attribute
The SVG component must include the
xmlns="http://www.w3.org/2000/svg"attribute: -
Invalid file type
Ensure your file has the correct extension:
.jsor.jsxfor JavaScript.tsor.tsxfor TypeScript- Note:
.d.tsdefinition files are excluded
-
Component not exported
By default, only exported components are shown. Enable the setting to show non-exported components:
-
Invalid SVG structure
The root element must be a valid SVG tag, not a Fragment:
Scanning not finding all icons
Scanning not finding all icons
Check Asset Paths
Configure specific directories where your icons are located:Review Ignored Directories
Make sure your icon directories aren’t being ignored:File Pattern Matching
The extension only scans files matching this pattern:Force Re-scan
- Clear the cache: Click the trash icon in the panel toolbar
- Run the scan command:
View Exports SVG: Start Scanningfrom the Command Palette
Performance issues with large projects
Performance issues with large projects
Panel not opening or showing errors
Panel not opening or showing errors
Reload the Window
Sometimes a simple reload fixes panel issues:- Open Command Palette (
Ctrl+Shift+PorCmd+Shift+P) - Run:
Developer: Reload Window
Check Extension Activation
The extension activates when you:- Right-click a
.js,.jsx,.ts, or.tsxfile - Run
View Exports SVG: Start Scanningfrom Command Palette
Verify File Context
The context menu only appears for files matching:Check for Conflicting Extensions
Disable other SVG-related extensions temporarily to identify conflicts.Icons not copying to clipboard
Icons not copying to clipboard
Clipboard Permissions
Ensure VS Code has clipboard access permissions on your operating system.What Gets Copied
When you click an icon, only the component name is copied to the clipboard, not the SVG code itself.Alternative: Use the Playground
To copy the full SVG code:- Click an icon to open it in the Playground
- Copy the code from the code editor panel
Clearing cache doesn't solve the issue
Clearing cache doesn't solve the issue
Manual Cache Clear
The cache is stored in VS Code’s global storage. To completely reset:- Click the trash icon in the panel toolbar
- Close and reopen VS Code
- Re-run the scan command
What the Cache Stores
The cache contains:- Last scan date
- Favorite icons
- Recent icons
- Workspace SVG component data
Clearing cache will remove your favorites and recent icons. They cannot be recovered.
Check Last Scan Date
You can verify when the last scan occurred:Theme not matching VS Code
Theme not matching VS Code
Reload Theme
Click the sync icon in the panel toolbar to reload the current theme.Theme Initialization
If the theme doesn’t load:- Close the View Exports SVG panel
- Reload VS Code window
- Reopen the panel
No Theme Found Error
This occurs when the extension cannot detect the workspace theme. Try:- Ensure you have an active workspace folder
- Check VS Code theme settings are properly configured
- Switch to a different VS Code theme and back
Playground not showing component preview
Playground not showing component preview
Component Validation
The playground requires valid SVG components. Check:- Root element is an SVG tag with xmlns attribute
- No syntax errors in the JSX code
- All JSX tags are properly closed
Error Messages
The extension provides detailed error messages:- “Invalid SVG tag” - Root element is not a valid SVG tag
- “Invalid xmlns attribute” - Missing or incorrect namespace
- “Empty opening element” - Malformed JSX structure
Playground Generation Errors
If you see “Error generating SVG playground”:- Check the browser console for detailed error messages
- Verify the component syntax is valid JSX
- Ensure all dynamic props have default values
Search not returning expected results
Search not returning expected results
DevTools panel not opening
DevTools panel not opening
Error Messages Reference
Common error messages and their meanings:| Error Message | Cause | Solution |
|---|---|---|
| ”Invalid SVG tag: Fragment” | Root element is a React Fragment | Use SVG element as root |
| ”Invalid xmlns attribute” | Missing or wrong namespace | Add xmlns="http://www.w3.org/2000/svg" |
| ”No SVG components found” | No exported SVG components in file | Check exports and SVG structure |
| ”Please enter at least 3 characters” | Search query too short | Enter 3 or more characters |
| ”No results found” | No components match search | Try different search terms |
| ”Error extracting SVG component” | Parsing error in component | Check JSX syntax and structure |
File Type Troubleshooting
Verify File Language Mode
Check the language mode in VS Code’s status bar:- Open your SVG component file
- Look at the bottom-right corner of VS Code
- It should show:
JavaScript ReactorTypeScript React
JavaScript or TypeScript, change it to the React variant.
Getting More Help
Check Console Logs
For detailed debugging information:- Open VS Code Developer Tools:
Help > Toggle Developer Tools - Check the Console tab for error messages
- Look for messages prefixed with “View Exports SVG”
Report Issues
If you continue experiencing issues:- Visit the GitHub Issues page
- Provide:
- VS Code version
- Extension version
- Sample code that reproduces the issue
- Error messages from the console
- Your configuration settings
Configuration Checklist
Use this checklist to verify your setup:- Files have correct extensions (
.js,.jsx,.ts,.tsx) - SVG components include
xmlns="http://www.w3.org/2000/svg" - Components are exported using ES6 syntax
- Asset paths are configured correctly
- Ignored directories don’t include icon folders
- Cache is cleared if seeing stale data
- VS Code is on a recent version
- Extension is up to date