Skip to content
DireWork

Troubleshooting

Common issues and solutions

Setup issues

bun install fails

Make sure you have Bun installed and you're on Node.js v22+:

bun --version    # Should be 1.3 or newer
node --version   # Should be v22 or higher

Don't have Bun yet? Install it from bun.sh. Update Node.js via nvm or the official installer.

bun run dev fails or nothing loads

  • Missing .env file: Make sure you copied .env.example to packages/infra/.env and filled in your Twitch keys and BETTER_AUTH_SECRET. See Getting started.
  • Slow first start: The first run creates the local database and compiles the apps. Give it a minute — later starts are much faster.
  • Port already in use: DireWork uses port 3000 (API), 3001 (web app), and 4000 (docs). See Port already in use below.
  • "Cannot deserialize secret" or a decryption error: local dev encrypts its saved state with ALCHEMY_PASSWORD when you set one, and with a fixed local password when you don't. If you add, change or remove ALCHEMY_PASSWORD, the state saved under the old one can't be read. Delete packages/infra/.alchemy (local state only; your deployed instance is not affected) and run bun run dev again.

Authentication issues

"Invalid redirect URI" from Twitch

Your Twitch application's redirect URLs don't match the ones DireWork is using. Make sure you've added both URLs in the Twitch Developer Console:

http://localhost:3001/api/auth/callback/twitch
http://localhost:3001/api/bot/callback/twitch

For production, add the same two paths on your workers.dev domain (https://dirework.<your-subdomain>.workers.dev/...). See Twitch integration setup for details.

Can't sign in / redirects back to login

  • Check that BETTER_AUTH_URL matches the URL you're accessing the app from exactly — protocol, host, and port (e.g., http://localhost:3001 locally, https://dirework.<your-subdomain>.workers.dev in production).
  • Check that CORS_ORIGIN matches as well.
  • Your Twitch redirect URLs must be on that same origin — a mismatch sends you in a loop.
  • Make sure your Twitch application's Client Type is set to Confidential.

"Your sign-in expired" on an open dashboard

The dashboard's sign-in ended while the page was open: you signed out in another tab, the session was revoked, or the Cloudflare Access session in front of the dashboard ran out. The dashboard stops refreshing so it doesn't spend requests that can only be refused, and the timer and task list it shows stop updating. Click Reload on the message (or reload the page) and sign in again. Your OBS overlays and the bot page don't use this sign-in, so they keep working the whole time.

"This DireWork already belongs to a different Twitch account"

The instance was already claimed — the first Twitch account to sign in owns it, and every other account is refused. Sign in with that account. If it isn't yours (someone signed in before you after the first deploy), follow Recovering an instance someone else claimed.

Bot account won't connect

  • "Sign in before connecting a bot account" on the home page means your DireWork session expired (or the connect link was opened in another browser). Sign in as the streamer, then click Connect bot account again.

  • "Only this DireWork's owner can connect a bot account" means the browser is signed in with a Twitch account that doesn't own this instance. Sign out, sign in as the owner, retry.

  • When connecting the bot, sign in to Twitch with the account you want the bot to use. A separate bot account is recommended; your own streamer account also works, but replies will come from you.

  • Make sure the second redirect URL (/api/bot/callback/twitch) is registered in your Twitch application.

Overlay issues

Overlay shows a blank page

  • OBS 31+ is recommended. OBS 28–30 is untested; OBS 27.1's Chromium 75-era browser source can't run DireWork's bundles.
  • While idle, the timer overlay shows a full preview (your work length and a full ring), not a blank page. If it stays blank, the URL or token is probably wrong (for example, it was regenerated) or the overlay cannot reach the API.
  • Check that the overlay URL is correct. Copy it again from OBS sources on the dashboard (the Timer or Tasks tab).
  • Treat overlay URLs as bearer credentials. If one was exposed, reset it and update OBS.
  • Try opening the overlay URL directly in your browser to see if it loads. If the page stays blank and the tab title reads Page not found, the URL is cut short or mistyped (for example, the token at the end is missing).

Overlay not updating in OBS

  • Overlays check for changes every few seconds — a short delay after adding a task or starting the timer is normal. The timer countdown itself ticks smoothly on the overlay, so it never looks laggy.
  • Did you regenerate the overlay token? Regenerating kills the old URL — re-copy the fresh URL from the dashboard and paste it into your OBS browser source.
  • OBS browser sources cache aggressively. Right-click the source and click Refresh cache of current page.
  • Make sure "Shutdown source when not visible" is checked in the browser source settings so it reloads when you switch scenes.

Completed tasks disappeared from the task list

That's the automatic cleanup: done tasks are deleted about 24 hours after they were completed (it runs when a task is added or completed, or the timer is started or reset). The list and overlay also show only the 50 most recently completed tasks — the done/total counter still counts every done task. Both keep each poll's database reads small enough for the D1 free tier; see D1 rows read.

"Too many requests" (HTTP 429)

The API rate-limits each client: by your signed-in session for dashboard traffic, and by IP address for everything else. A single streamer stays far below the limits, so repeated 429s on the dashboard usually mean several dashboard tabs are polling at once (close the extras) — or, after an upgrade, that the deploy is missing PROXY_SECRET, in which case the deploy fails validation; add the secret (see Deployment) and redeploy.

Overlay has a white/colored background in OBS

The overlays are designed to be transparent. In OBS browser source settings, make sure Custom CSS is not overriding the background. The default CSS should be fine — just leave it empty or at the OBS default.

Timer issues

Timer stuck at 0:00 / not transitioning

The timer only moves forward while something is watching it — an open timer overlay in OBS (which checks in every few seconds), an open dashboard, or an incoming chat command. There is no always-on server, so something has to be watching for the timer to advance.

  • Keep a timer overlay live in OBS (or the dashboard open) while the timer is running — either one nudges it forward
  • If the timer is genuinely stuck, try clicking Stop (square button) and starting a new session

Timer starts but only counts down 5 seconds

This is the starting phase — a 5-second countdown before Focus begins. After the countdown reaches 0, the timer automatically moves into the Focus phase (25 minutes by default). If it doesn't, see the issue above.

Timer settings not saving

Timer duration settings (Focus, Break, Long break, interval, pomos) are saved when you click out of the input field. Make sure to:

  1. Change the value in the input
  2. Click somewhere else or tab out of the field
  3. Wait for the "Timer settings saved" toast

Settings are only editable when the timer is idle or finished. They're disabled during an active session.

Timer doesn't use my configured duration

If you changed the work duration (e.g. to 50 minutes) but the timer still uses 25 minutes:

  • Make sure you saved the setting (click out of the input field)
  • Stop any running timer session with the stop button
  • Start a new session — the timer reads durations from the database when starting

Chat bot issues

Bot not responding to commands

The bot only listens to chat while its bot page is open somewhere. Run through this list:

  • Is a bot page open? Copy the Widget URL or Dock URL from Dashboard → Bot and keep it open: the widget in an OBS browser source or a Moblin widget, or the dock in an OBS custom browser dock or one pinned browser tab. The widget is blank on purpose; its tab title (or the dock) shows whether it's connected, and the dashboard's bot chip says Bot connected while one is running (it turns Bot offline a few minutes after the last one closes). If no copy is open, the bot hears nothing. A closed OBS dock counts as not open — tab it behind another dock instead of closing it.
  • Is it running somewhere else? Only one bot page joins chat at a time. Any other copy you open stands by: its tab title says Standby and the dock says The bot is running somewhere else. Click Take over in that dock to move the bot there (the other page stands by within 2 minutes, or at once the next time it relays a command). A standby page takes over on its own once the running page closes, at most about 5 minutes later. Each open page checks in every 2 minutes (one Worker request), so close copies you don't need.
  • Was the bot token regenerated? Regenerating the token kills any previously copied widget and dock URL (they share one token). Re-copy the fresh URL from Dashboard → Bot and update your OBS source, Moblin widget, dock or pinned tab. Treat this URL as a bearer credential and never post it publicly.
  • Is a bot account connected? Check the Bot account card — connect a bot account if it isn't.
  • Is the bot muted? A muted bot ignores every command and posts nothing; the dock (and the widget's tab title) says Muted and Dashboard → Bot shows the Mute bot switch on. Flip the switch off, or have a mod send !unmute.
  • Is that viewer blocked? Blocked viewers get no reply at all. Check the Blocked viewers list in the Moderation card on Dashboard → Bot.

Commands work but messages aren't sent

  • The bot account needs the chat:read and chat:edit scopes (the IRC connection the bot page uses requires them). If you connected the bot before these scopes were required, disconnect and reconnect it.
  • Check that the bot account isn't banned or timed out in your channel. When Twitch refuses a reply (ban, timeout, slow mode, followers-only, subscribers-only), the dock's LED turns amber, its header reads Chat error (so does the widget's tab title), and the reason shows under Last error.

Development issues

TypeScript errors after pulling changes

Check types:

bun run check-types

Changes to Drizzle schema not reflected

After modifying the schema files in packages/db/src/schema/, generate a migration:

bun run db:generate

Migrations are applied to the local database automatically the next time you run bun run dev (and to production on deploy).

Port already in use

The API runs on port 3000, the web app on 3001, and the docs on 4000. If one of these ports is taken:

  • Find what's using the port: lsof -i :3001
  • Kill that process, or change the port in the respective app's dev configuration.

Still stuck?

If your issue isn't covered here:

  • Check the GitHub Issues for known bugs
  • Open a new issue with details about your environment and the error you're seeing
  • Join the Discord for community help