Symptom: Build fails with various webpack-related errors.
Fix: Always use the webpack flag:
pnpm build --webpackThe default Turbopack bundler can crash with port binding errors. Webpack is the stable path.
Symptom: Missing dependency during build.
Fix: Install the missing package:
pnpm add <package-name>Common ones that may need manual installation:
@workos-inc/authkit-nextjscreate-markdowntw-animate-cssdompurify
Symptom: Property 'typescriptDefaults' does not exist or similar.
Context: Monaco's TypeScript types are deprecated in newer versions.
Fix: Use beforeMount callback with optional chaining:
const handleBeforeMount: BeforeMount = (monaco) => {
monaco.languages.typescript?.typescriptDefaults?.setDiagnosticsOptions({
noSemanticValidation: true,
})
}Symptom: Build fails on regex with (?<name>...) syntax.
Fix: Ensure tsconfig.json has "target": "ES2022" or later.
Symptom: pnpm tauri:dev or pnpm tauri:build fails because cargo is not found.
Cause: Rust/Cargo is not in PATH for the shell Tauri spawns.
Fix:
-
Ensure Rust is installed:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
-
Add to your shell profile (
~/.zshrcfor macOS):echo '. "$HOME/.cargo/env"' >> ~/.zshrc source ~/.zshrc
-
Verify:
cargo --version # should print cargo 1.x.x rustc --version # should print rustc 1.x.x
-
Restart your terminal (or source the profile) before running Tauri commands.
Expected behavior. The first build compiles all Rust dependencies (~300 crates). This takes 2-5 minutes on M-series Macs, longer on older hardware.
Subsequent builds only recompile changed code and are much faster (<30 seconds).
Symptom: Compilation errors mentioning Xcode, SDK, or system frameworks.
Fix: Ensure Xcode Command Line Tools are installed:
xcode-select --installIf already installed, try resetting:
sudo xcode-select --resetPossible causes:
-
Dev server not running:
pnpm tauri:devshould start Next.js dev server automatically. Check that port 3080 is free:lsof -i :3080
-
CSP blocking: Check the browser console (right-click → Inspect in the Tauri window). If CSP errors, check
src-tauri/tauri.conf.jsonhas"csp": null. -
Static export issues: For production builds, ensure
next.config.tshas the Tauri conditional:const isTauri = process.env.TAURI_ENV_PLATFORM !== undefined const nextConfig = { ...(isTauri ? { output: 'export' } : {}) }
Symptom: Login form shows "origin not allowed (open the Control UI from the gateway host or allow it in gateway.controlUi.allowedOrigins)".
Cause: The code-editor's origin is not in the gateway's allowed origins list.
Fix: Add the origin to ~/.openclaw/openclaw.json:
{
"gateway": {
"controlUi": {
"allowedOrigins": [
"http://localhost:3080",
"http://127.0.0.1:3080",
"https://editor.openknot.ai"
]
}
}
}Then restart the gateway:
openclaw gateway restartSymptom: Messages send but no reply appears. Spinner stays forever.
Possible causes:
-
Gateway not running:
openclaw gateway status # If stopped: openclaw gateway start -
Session not initialized: The system prompt may not have been injected. Clear
sessionStoragein browser DevTools and reload. -
Streaming event handler: The agent panel relies on
onEvent('chat')to receive replies. Check the browser console for WebSocket errors. -
Model quota exceeded: If using a rate-limited model, the gateway may silently fail. Check gateway logs:
openclaw logs
Symptom: Login shows pairing instructions.
Fix: On the gateway host machine:
openclaw devices list # find the pending request
openclaw devices approve <request-id>Then click Connect again in the editor.
Symptom: Every import statement has red underlines.
Cause: Monaco tries to type-check TypeScript/JavaScript files but has no tsconfig or type definitions.
Fix: This is already handled — beforeMount disables semantic validation. If you still see red lines:
- Hard refresh the page (Cmd/Ctrl+Shift+R)
- Check that the
handleBeforeMountcallback is being called
Symptom: Editor doesn't match the selected theme.
Cause: registerEditorTheme() reads CSS variables at mount time. If the theme changes after mount, the editor won't update.
Workaround: Refresh the page after switching themes. The theme will be applied on next mount from the persisted localStorage value.
Symptom: Editor area is blank for several seconds on first load.
Expected behavior. Monaco loads ~2MB of JavaScript on first render. The monacoReady state shows a blank area until loaded.
Optimization: Monaco chunks are cached by the browser after first load.
Possible causes:
-
No repo selected: Enter a repo in the selector (e.g.,
OpenKnots/code-editor). -
No GitHub token: The tree API requires a GitHub token. Set
GITHUB_TOKENin your environment (or Vercel env vars for production). -
API response format: The tree API returns
{ entries }. If the context readsdata.treeinstead, files won't appear. This was fixed — ensure you're on the latest commit. -
Private repo: Ensure the GitHub token has access to the repository.
Cause: Binary files (images, compiled assets) are base64-decoded as text.
Fix: The editor detects binary file types and shows appropriate previews (image, video, audio). If a file type isn't detected, it falls back to text rendering.
Symptom: Page keeps redirecting to WorkOS login and back.
Fix: Check that WORKOS_CLIENT_ID, WORKOS_API_KEY, and WORKOS_REDIRECT_URI are set correctly in environment variables.
For local development, the redirect URI should be http://localhost:3080/callback.
Symptom: Successfully logged in via WorkOS but see "Access Denied".
Cause: ALLOWED_USER_EMAIL or ALLOWED_USER_ID is set and your account doesn't match.
Fix: Either:
- Update the env var to match your email/user ID
- Remove the env var to allow all authenticated users
Cause: Large repos (10,000+ files) create a heavy tree in memory.
Workarounds:
- Use the search to filter before browsing
- Tree rendering uses virtual-ish approach (dirs collapse by default)
- Consider filtering tree API response server-side for very large repos
Possible causes:
- Model choice: Larger models (Opus) take longer than smaller ones (Haiku)
- Context size: Files >8KB are truncated in context injection to prevent overload
- Gateway load: Multiple sessions competing for the same gateway
| Variable | Purpose | Required |
|---|---|---|
GITHUB_TOKEN |
GitHub API access | Yes |
WORKOS_CLIENT_ID |
WorkOS OAuth | Yes (web) |
WORKOS_API_KEY |
WorkOS server auth | Yes (web) |
WORKOS_REDIRECT_URI |
OAuth callback URL | Yes (web) |
ALLOWED_USER_EMAIL |
Restrict to one user | No |
ALLOWED_USER_ID |
Restrict to one user | No |
ALLOWED_IPS |
IP allowlist (CIDR) | No (* = disabled) |