Common Issues and Solutions
Script Tag References
"Bundle failed" or Cannot Resolve Module
Problem: HTML references .js but source files are .ts
<!-- WRONG -->
<script src="index.js"></script>
<!-- CORRECT -->
<script type="module" src="index.ts"></script>
Tkeron uses Bun.build() to bundle. Always reference .ts files in HTML — Tkeron compiles .ts → .js and updates the reference.
Component Naming
Component Name Must Contain Hyphen
<!-- WRONG (reserved HTML tag) -->
<header></header>
<!-- CORRECT -->
<app-header></app-header>
Custom elements must contain at least one hyphen. This is a web standard.
File References
Assets Not Found After Build
<!-- Breaks if HTML moves -->
<img src="images/logo.png" />
<!-- Works from any location -->
<img src="./images/logo.png" />
Always use explicit relative paths (./ or ../).
Component Resolution
Component Not Found
Tkeron searches for components in this order:
- Same directory as the HTML file
- Any subdirectory of
websrc/via glob search (**/${tagName}.com.*)
Components can live in any subdirectory and will be found automatically. The first glob match is used when multiple matches exist.
TypeScript Compilation
Type Errors
Tkeron's TypeScript compilation is transpile-only — it does NOT type-check. Bun's transpiler converts .ts → .js without running the type checker.
For type checking, use your editor or run tsc --noEmit separately.
Use tkeron.d.ts (included in tk init projects) for com autocompletion in .com.ts files. The document variable in .pre.ts files is available through lib: ["DOM"] in the generated tsconfig.json.
Build Performance
Slow Builds
- Use
tk devfor development (hot reload) - Only
tk buildfor production - Keep assets reasonably sized
- Avoid excessive component nesting
Common AI Agent Mistakes
When AI agents build Tkeron projects:
- Script references: Always
.tsin HTML, never.js - Component names: Must contain hyphen
- Type safety: Don't over-complicate with types
- File paths: Use explicit relative paths
- CLI args:
tk buildandtk dev— no directory arguments (fixed convention:websrc/→web/)
Troubleshooting
"Source directory does not exist"
ls websrc # Check if websrc/ exists
tk init . # Or initialize project in current dir
"Command not found: tk"
bun install -g tkeron # Reinstall globally
Port already in use
tk dev 3001 # Use different port
Components not working
- Name must contain a hyphen
- File must be named exactly:
user-card.com.html - Must be in
websrc/or any subdirectory ofwebsrc/
Build hangs
- Check for infinite loops in
.pre.tsor.com.ts - Check for API requests without timeout
- Press
Ctrl+Cand review your code
Next Steps
- Best Practices — Patterns and anti-patterns
- CLI Reference — All commands
- Overview — Return to docs home