Troubleshooting
Fixes for common Teact issues — command not found, a bot that won't respond, edge gotchas, and TypeScript/JSX errors.
Quick fixes for the issues you're most likely to hit when starting out. Running teact doctor
inside a project also checks your setup and suggests fixes.
teact: command not found
Fresh bun create teact installs now resolve this automatically — the scaffolder pins a published
@teactjs/cli version so the local teact binary always lands in node_modules/.bin. If you still
see it in an older or hand-assembled project:
-
Re-run install from the project root so the binary is (re)created:
bun install -
Make sure
@teactjs/cliis in yourpackage.json(devDependenciesordependencies). Thedev,build, andstartscripts all rely on it. -
Run scripts through your package manager (
bun dev,bun run build) so the local binary onnode_modules/.binis used rather than a missing global one.
Bot doesn't respond
If the bot starts but never replies to messages:
-
Check the token.
TELEGRAM_BOT_TOKENmust be set in.env(it is always this name). Confirm there's a real value after the=:# .env TELEGRAM_BOT_TOKEN=123456:ABC-DEF... -
Only run one polling instance. Telegram allows a single
getUpdatesconsumer per token. If a secondbun dev(or a deployed instance) is polling the same token, neither will receive updates reliably. Stop the duplicate, or switch one to webhook mode. Guardingbot.start()behindif (import.meta.main)prevents accidental double-starts when the file is imported. -
Send
/startor a message to the bot in Telegram, and watch the dev console for incoming updates.
Edge / serverless gotchas
On Cloudflare Workers, Vercel Edge, and Deno Deploy the isolate freezes once the Response
resolves, and there is no filesystem. Rendering and the reply itself complete before
bot.fetch() returns, but background work does not survive. The most common surprises:
teact.config.tsis ignored (loading it needsfs). Passpluginsand other options directly tocreateBot({ plugins }).- In-memory session doesn't persist. Provide a durable
SessionStore(KV/Redis/DB) viacreateBot({ session: { store } }). - The
'file'storage driver can't write — it warns and degrades to memory. Use a custom async-backedStorageDriver. - Post-commit side effects are dropped.
useStream,useQuery, and work inuseEffect/useOnthat runs after the first commit won't finish before the freeze. These are fine under long-running polling.
See Deployment for the full edge setup.
Text renders with stray tags or won't send
- Don't hand-concatenate HTML into message text. Content inside
<Bold>,<Italic>,<Code>, and plain message text is auto-escaped when HTML mode is active. If you setparseMode="HTML"yourself on a<Message>, your text is passed verbatim and you own the escaping. - Message limits are clamped, not errored: text is capped at 4096 chars, captions at 1024, and media groups at 2–10 items (a single item is sent as a normal media message).
- You can't edit text onto a photo in place (or vice-versa). The engine sends a new message when the media kind changes instead of editing.
TypeScript / JSX errors
Teact uses the React JSX runtime. Your tsconfig.json needs:
{
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "react"
}
}Scaffolded projects include this already. If you see "Cannot use JSX unless the '--jsx' flag is
provided" or unexpected JSX.IntrinsicElements errors, this is the setting to check.