Troubleshooting
Common issues and solutions when working with CEM.
Manifest is empty
Make sure your glob pattern matches your files:
cem generate --verboseCheck the .config/cem.yaml generate.files glob pattern matches your source files.
Component not showing in dev server
- Regenerate manifest:
cem generate - Check file patterns: Verify
generate.filesglob in.config/cem.yaml - Verify package.json: Ensure
customElementsfield exists - Verify manifest content:
cem list - Check demos: Ensure demo files exist and are discoverable
- Restart the server:
cem serve
Demos not discovered
Check demo file location matches discovery patterns:
- Files in
demo/ordemos/directories - Files named
*.demo.html - Or configured in
.config/cem.yaml
See Working with Demos for details on demo discovery configuration.
TypeScript errors
Ensure you have a tsconfig.json:
{
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "bundler",
"experimentalDecorators": true
}
}LSP features not working
- Check manifest exists:
ls custom-elements.json - Verify manifest content:
cem list - Verify LSP is running: Check editor’s LSP status
- Regenerate if stale:
cem generate - Check LSP logs in your editor
- Restart editor: Reload window
See Using LSP Features for more details.
Dev server won’t start
Check for port conflicts:
# Try a different port
cem serve --port 3000Check for syntax errors:
# Validate your manifest
cem validateImport maps not working
- Check package.json: Ensure dependencies are listed
- Restart server:
cem servepicks up package.json on startup - Clear browser cache: Hard reload (Ctrl+Shift+R / Cmd+Shift+R)
See Import Maps for configuration details.
Changes not refreshing
- Check live reload is enabled (default)
- Look for errors in browser console
- Verify source maps for TypeScript
- Clear browser cache if needed
Get Help
- Documentation - Browse all docs
- GitHub Issues - Report bugs or request features
- Examples - See working examples