Production Issues Ai Gograb Space Analysis
Documentation for Sessions
Production Issues Analysis: ai.gograb.space/dashboard
Date: 2026-03-12
Session: 213
Status: Analysis Complete
Executive Summary
The production app at https://ai.gograb.space/dashboard exhibits three distinct issue categories:
- MIME type errors (service-worker.js, chunk JS files) — Certain root cause
- WebSocket malformed URLs (
wss://https/socket.io/) — Likely config/construction bug - 401 Unauthorized / Login failed — Likely auth flow or backend
Issue 1: MIME Type Errors (Certain)
Symptoms
SecurityError: Failed to register a ServiceWorker... The script has an unsupported MIME type ('text/html')Failed to load module script: Expected a Javascript... but the server responded with a MIME type of "text/html"ERROR TypeError: Failed to fetch dynamically imported module: https://ai.gograb.space/src-2G30GIMY.js
Root Cause
Two contributing factors:
A. Overly aggressive _redirects rule
/* /index.html 200
"Redirects are always followed, regardless of whether or not an asset matches the incoming request."
The /* rule matches every request (including /service-worker.js, /main-*.js, /src-*.js) and rewrites it to /index.html. The browser receives HTML with Content-Type: text/html instead of JavaScript, causing MIME type errors.
B. Service worker not built before deploy
deployment/cloudflare/deploy-ai.sh runs only nx build, not nx build-full or nx build-sw:
yarn nx build $NX_NAME --configuration=production --skip-nx-cache
The build-sw target (which produces service-worker.js) is never executed. Even if the redirect were fixed, /service-worker.js would 404 because the file is never built.
Fix (Issue 1)
Remove or replace the catch-all redirect — Use 404.html fallback instead:
- Remove
/* /index.html 200from_redirects - Add
index.htmlas404.htmlin the build output so Cloudflare serves it for non-existent routes (SPA client-side routing) - Static assets (
.js,.css, etc.) will then be served correctly when they exist
- Remove
Include service worker in deploy — Update
deploy-ai.shto runnx build-fullor addnx build-sw gograb-aiafter the main build soservice-worker.jsis present in the output.
Issue 2: WebSocket Malformed URL (Likely)
Symptoms
WebSocket connection to 'wss://https/socket.io/?EIO=4&transport=websocket' failed
The host is https instead of ai-api.gograb.space — the URL is malformed.
Root Cause (Speculative)
Socket.IO clients receive a base URL that is either:
- A bare protocol (
https) used as host - A full URL passed where only host/path was expected
- A misconfiguration in how
AI_API_URLorbackendAiApiUrlis passed toio()
Relevant code:
BridgeMcpConnectorServiceusesenvironment.backendAiApiUrl→io(\${backendUrl}/mcp-stream`, ...)`AwarenessDataServiceusesAI_API_URL→url = this.aiApiUrl.replace(/\/ai-api$/, '')→io(\${url}/awareness`, ...)`VittoScreenCaptureServiceusesVITTO_API_URL→io(\${wsUrl}/local-bridge`, ...)`
Production environment.prod.ts has:
backendAiApiUrl: 'https://ai-api.gograb.space'aiApiUrl: 'https://ai-api.gograb.space/ai-api'
These should produce valid Socket.IO URLs. The wss://https/ pattern suggests a bug in URL construction or in a library that receives the wrong base URL.
Fix (Issue 2)
- Add logging in production (or temporary) to log the exact URL passed to each
io()call. - Search for any place that passes
path,host, orurlincorrectly to Socket.IO. - Ensure no code passes a full URL where Socket.IO expects only host/path, or vice versa.
Issue 3: 401 Unauthorized / Login Failed (Likely)
Symptoms
Failed to load resource: the server responded with a status of 401 ()[Vitto AI] Login failed: Invalid email or password.
Root Cause (Speculative)
- Incorrect credentials
- Backend auth service misconfiguration (e.g. JWT validation, DB)
- CORS or cookie/session handling in production
- Multi-tenant context not applied correctly
Fix (Issue 3)
- Verify credentials and auth flow in production.
- Check backend-ai-api and backend-api logs for 401s.
- Confirm CORS and auth headers for
ai.gograb.spaceandai-api.gograb.space.
Recommended Action Order
| Priority | Action | Impact |
|---|---|---|
| 1 | Fix _redirects (remove catch-all, add 404.html) |
Unblocks JS loading and SW registration |
| 2 | Add build-sw to deploy-ai.sh |
Enables service worker when redirect is fixed |
| 3 | Debug WebSocket URL construction | Restores real-time features |
| 4 | Investigate 401/auth | Restores login and protected features |