Closed wesleywcr closed 1 year ago
I'm not sure how to help you debug it but I don't think the issue is JS SDK related.
Double check that client can access the PocketBase server.
Does regular requests works?
Where the above code is being executed - browser, servers-side, React Native?
I'll close the issue for now as there is no actionable item, but feel free to provide more details about your setup and ideally some minimal steps to reproduce, and I'll have a look.
On second read, I missed that in the title is mentioned React Native.
In this case, you need a EventSource polyfill, for example react-native-sse
:
import eventsource from "react-native-sse";
global.EventSource = eventsource;
You could also check the comment in https://github.com/pocketbase/pocketbase/discussions/2484#discussioncomment-6118523.
I've already added react-native-sse
, others requests in pocketbase work normally. Only the question of the real time that generates the above error. Do I need to add another configuration to my project?
@wesleywcr Please check the linked resources in https://github.com/pocketbase/pocketbase/discussions/2484#discussioncomment-6118523.
If that doesn't help, please provide more details how you are testing and ideally create a minimal reproducible repo and I'll investigate it further.
It seems like it was a problem in the expo version. I was using SDK 49, I downgraded it to SDK 48 and worked normally.
I'm trying to make a real-time connection in a chat on my app. But I'm facing this problem with the connection:
Error Subscribe: [Error: EventSource connect took too long.]
My code:What can I do to make the real time functionality work correctly?