Troubleshooting
Common issues and solutions when building custom visuals
"Element type is invalid" Error
This is the most common error. It occurs when component names don't match across files.
Symptom:
Cause: Name mismatch between configuration and exports.
Example of the problem:
Fix: Ensure all three names match exactly:
Checklist when renaming components:
- Function name in
.tsxfile - Export in
index.ts -
componentfield incomponents.config.ts - Key in
sample-data-registry.ts - Run
npm run build
Component Not Appearing in Semaphor
- Verify export: Is the component exported in
index.ts? - Check config: Is it registered in
components.config.ts? - Verify names match: Does
componentexactly match the exported function name? - Rebuild and republish:
npm run build && semaphor publish - Hard refresh: Clear browser cache and reload Semaphor
Data is Empty
- Configure data source: Ensure the card has a data source in Semaphor
- Check column names: Verify you're accessing correct column names
- Add debugging:
console.log('data:', data)to inspect - Handle empty state: Always check
if (!data || data.length === 0)
Debug pattern:
Inline Filters Not Showing
- Default to
[]: EnsureinlineFilters = []in props destructuring - Check conditional: Use
inlineFilters.length > 0before rendering - Configure in Semaphor: Inline filters must be added to the card in Semaphor's visual editor
Correct pattern:
Styling Issues
CSS Not Loading
- Import CSS: Verify
../index.cssis imported inindex.ts - Check build output: Ensure
dist/style.cssexists after build
Tailwind Classes Not Working
All Tailwind utilities are available. If classes aren't applying:
- Check for typos in class names
- Ensure you're not overriding with inline styles
- Check CSS specificity issues
Theme Colors Not Applying
- Use theme prop: Access colors via
theme?.colors - Provide fallbacks: Always have fallback colors
Dark Mode Issues
Use conditional styling based on theme?.mode:
Or use Tailwind's dark mode classes (if configured):
Showcase Not Showing Component
- Check registry: Is the component registered in
sample-data-registry.ts? - Verify key: The registry key must match the component name exactly
- Check data file: Ensure
.data.tsexportssampleData
Registry format:
Data file format:
Build Errors
Clean Rebuild
TypeScript Errors
Run type checking independently:
Missing Dependencies
If you're using external libraries:
Then verify it's included in the bundle by checking dist/index.js size.
Publishing Issues
"Unauthorized" Error
- Verify your project credentials in
semaphor.json - Re-run
semaphor initto update credentials - Check that your Semaphor project ID matches
Plugin Not Updating
- Increment version in
package.json - Rebuild:
npm run build - Republish:
semaphor publish - Hard refresh Semaphor dashboard (Ctrl+Shift+R)
Manifest Not Generated
The manifest is generated from components.config.ts during build. Ensure:
components.config.tshas valid syntax- All registered components are exported in
index.ts - Build completes without errors
Performance Issues
Component Re-rendering Too Often
Use useMemo for expensive calculations:
Large Dataset Handling
For datasets over 1000 rows:
- Consider virtualization (react-virtual, react-window)
- Paginate on the server side
- Aggregate data in SQL before sending to the visual
Multi-Input Visual Issues
Data Not Loading for All Slots
- Check that all slot cards have valid data sources
- Verify
dataInputCardIdsmapping is correct - Ensure the source cards exist on the dashboard
CardMetadata Array Empty
Multi-input visuals receive an array of metadata. Check the array length:
See the Multi-Input Guide for detailed troubleshooting.
Getting Help
If you're still stuck:
- Check browser console: Look for JavaScript errors
- Check network tab: Verify plugin bundle is loading
- Simplify: Start with a minimal component and add complexity
- Contact support: support@semaphor.cloud