Troubleshooting
Common issues and solutions
Common issues and how to resolve them.
Installation Issues
Command not found
Problem: denji: command not found
Solution: Ensure Denji is installed and in your PATH:
npm install -D denjinpm run denji --versionOr use via package.json scripts:
{
"scripts": {
"icons:add": "denji add",
"icons:list": "denji list"
}
}Configuration Issues
Config not found
Problem: Config file not found
Solution: Initialize config first:
denji initOr create denji.json manually:
{
"$schema": "./node_modules/denji/configuration_schema.json",
"output": "./src/icons.tsx",
"framework": "react",
"typescript": true
}If Denji is not installed locally (e.g., using npx, bunx, pnpx, yarn dlx), use "https://denji-docs.vercel.app/configuration_schema.json" for the $schema field instead.
Invalid config
Problem: Invalid configuration
Solution: Validate config against schema. Check:
- All required fields present (
output,framework) - Correct types for each field
- Valid enum values (e.g.,
a11ymust be one of allowed values)
Icon Issues
Icon not found
Problem: Icon lucide:invalid-name not found
Solution:
- Check icon exists on Iconify
- Verify correct prefix and name format:
prefix:name - Check for typos in icon name
Duplicate icons
Problem: Adding same icon multiple times
Solution: Denji automatically deduplicates. Re-adding an icon updates it.
Icons not updating
Problem: Changes not reflected in app
Solution:
- Check output file was updated
- Restart dev server
- Clear build cache
- Verify import path is correct
TypeScript Issues
Type errors
Problem: TypeScript errors when importing icons
Solution:
- Ensure
typescript: truein config - Check output file has
.tsxextension - Verify TypeScript can resolve the file:
import { Icons } from "./icons"; // Should have auto-completionMissing types
Problem: No auto-completion for icon names
Solution: The icons file exports typed components. Ensure:
- Using
.tsxextension - File is in TypeScript project
- Editor has loaded the file
Accessibility Issues
Wrong aria attributes
Problem: Icons have incorrect accessibility attributes
Solution: Set a11y strategy:
In config:
{
"a11y": "hidden"
}Per icon:
denji add lucide:check --a11y imgPer usage:
<Icons.Check aria-hidden="true" />Hook Issues
Hooks not running
Problem: Lifecycle hooks don't execute
Solution:
- Check hook commands are valid shell commands
- Ensure hooks array syntax is correct:
{
"hooks": {
"postAdd": ["echo 'Done'"]
}
}- Check command permissions
- Verify output file path in hook matches config
Hook errors
Problem: Hook command fails
Solution:
- Test command manually in terminal
- Use absolute paths in hooks
- Check command is installed
- Add error handling to hook commands
Integration Issues
Bundler errors
Problem: Build fails with icon imports
Solution:
- Ensure bundler can handle JSX/TSX
- Check output file is included in build
- Verify import path is correct
Framework compatibility
Problem: Icons don't work in framework
Solution: Denji supports React, Preact, Solid, Qwik, Vue, and Svelte. Ensure:
- Your
denji.jsonhas the correctframeworkvalue - The output file extension matches the framework
- Your project has the framework dependencies installed
Getting Help
Still stuck?
- Check GitHub Issues
- Search existing issues for similar problems
- Create new issue with:
- Denji version (
denji --version) - Node/Bun version
- Config file contents
- Error messages
- Steps to reproduce
- Denji version (