You are getting an error TypeError: Cannot read properties of undefined (reading 'find') when adding an action using a custom connector that uses Server-Sent Events (SSE) with text/event-stream in Copilot Studio. The connector works in Power Apps and passes all tests, but fails in Copilot Studio with a browser console error.
1. Copilot Studio might not fully support text/event-stream responses in custom connectors, especially when used directly as an action. This response type is streaming and may not be parsed properly.
2. Check if your operation in the connector returns a well-defined schema. Even though it's streaming, define a response like:
json >
{
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
3. Go to the custom connector JSON file or definition, check responses section for the operation and ensure there's a 200 response with correct schema.
4. Avoid using text/event-stream directly. Try modifying the backend to respond with application/json temporarily to test. If it works, issue is with SSE not being handled by Copilot Studio UI.
5. If possible, switch the SSE call to a polling-based API (e.g., fetch latest message via GET every few seconds). This avoids streaming and works with Copilot.
6. Check if the connector exceeds response size limit (500 KB), Copilot Studio has strict limits.
7. If you need to keep using SSE, do not define it as an action. Handle it outside Copilot Studio or via Power Automate, then pass results to Copilot Studio using environment variables or a data source.
8. Use browser dev tools > Network tab to confirm Copilot Studio is sending request correctly and backend is returning proper headers (Content-Type: text/event-stream).
9. As a workaround, build a proxy API that converts the SSE stream to regular JSON responses.
10. If nothing works, open Microsoft support ticket with full connector definition, console error, and steps to reproduce.