Skip to content

AI-native design editor. Open-source Figma alternative.

fix(tauri): ATS exception for localhost WebSocket on macOS

Danila Poyarkov837c09bd7851
diff --git a/desktop/tauri.conf.json b/desktop/tauri.conf.json
index 872527797..80d44cee3 100644
--- a/desktop/tauri.conf.json
+++ b/desktop/tauri.conf.json
@@ -32,7 +32,12 @@
"icons/icon.ico"
],
"macOS": {
- "signingIdentity": "Developer ID Application: Danila Poyarkov (N7D7M3Q3CD)"
+ "signingIdentity": "Developer ID Application: Danila Poyarkov (N7D7M3Q3CD)",
+ "info": {
+ "NSAppTransportSecurity": {
+ "NSAllowsLocalNetworking": true
+ }
+ }
}
}
}
diff --git a/src/automation/server.ts b/src/automation/server.ts
index 5d806495e..101afee48 100644
--- a/src/automation/server.ts
+++ b/src/automation/server.ts
@@ -165,12 +165,14 @@ export function connectAutomation(getStore: () => EditorStore, authToken: string
function connect() {
try {
ws = new WebSocket(`ws://127.0.0.1:${AUTOMATION_WS_PORT}`)
- } catch {
+ } catch (e) {
+ console.error('[Automation] WebSocket constructor failed:', e instanceof Error ? e.message : e)
scheduleReconnect()
return
}
ws.onopen = () => {
+ console.log('[Automation] WebSocket connected to MCP server')
ws?.send(JSON.stringify({ type: 'register', token }))
}
@@ -201,12 +203,14 @@ export function connectAutomation(getStore: () => EditorStore, authToken: string
}
}
- ws.onclose = () => {
+ ws.onclose = (event) => {
+ console.error('[Automation] WebSocket closed:', `code=${event.code} reason=${event.reason}`)
ws = null
scheduleReconnect()
}
- ws.onerror = () => {
+ ws.onerror = (event) => {
+ console.error('[Automation] WebSocket error:', event)
ws?.close()
}
}
diff --git a/src/automation/spawn-mcp.ts b/src/automation/spawn-mcp.ts
index 659974fc9..dd048b500 100644
--- a/src/automation/spawn-mcp.ts
+++ b/src/automation/spawn-mcp.ts
@@ -24,7 +24,8 @@ async function readHealth(): Promise<AutomationHealth | null> {
})
if (!res.ok) return null
return (await res.json()) as AutomationHealth
- } catch {
+ } catch (e) {
+ console.error('[MCP] health check failed:', e instanceof Error ? e.message : e)
return null
}
}
diff --git a/src/components/chat/ProviderSelect.vue b/src/components/chat/ProviderSelect.vue
index 90387b267..6aa6e90b8 100644
--- a/src/components/chat/ProviderSelect.vue
+++ b/src/components/chat/ProviderSelect.vue
@@ -19,7 +19,8 @@ async function checkMCPHealth(retries = 3, delayMs = 1000) {
mcpAvailable.value = true
return
}
- } catch {
+ } catch (e) {
+ console.error('[MCP] health check failed (attempt', i + 1, '):', e instanceof Error ? e.message : e)
if (i < retries - 1) await new Promise((r) => setTimeout(r, delayMs))
}
}