fix: Add n8n environment variables to production deployment
Some checks failed
Production Deployment (Zero Downtime) / deploy-production (push) Failing after 10m24s

- Add N8N_WEBHOOK_URL, N8N_SECRET_TOKEN, N8N_API_KEY to docker-compose.production.yml
- Export environment variables in workflow before docker-compose up
- Improve error logging in chat API for better debugging
- Add better error handling in ChatWidget component
- Create setup guide for n8n chat configuration
This commit is contained in:
2026-01-09 19:40:00 +01:00
parent bd73a77ae3
commit c989f15cab
5 changed files with 199 additions and 8 deletions

View File

@@ -129,10 +129,21 @@ export default function ChatWidget() {
});
if (!response.ok) {
throw new Error("Failed to get response");
const errorText = await response.text().catch(() => 'Unknown error');
console.error("Chat API error:", {
status: response.status,
statusText: response.statusText,
error: errorText,
});
throw new Error(`Failed to get response: ${response.status} - ${errorText.substring(0, 100)}`);
}
const data = await response.json();
// Log response for debugging (only in development)
if (process.env.NODE_ENV === 'development') {
console.log("Chat API response:", data);
}
// Decode HTML entities in the reply
let replyText = data.reply || "Sorry, I couldn't process that. Please try again.";