Closed stephanoparaskeva closed 3 years ago
@stephanoparaskeva It's interesting that it works with axios directly. We do add additional request options to axios, so I'm wondering if one these causes an issue in a React Native environment: https://github.com/typesense/typesense-js/blob/a1def5f9faa30c64b0732dc0bb7ea5120e7e9144/src/Typesense/ApiCall.js#L54-L77
To help debug this, could you try two things:
Change localhost to an IP address. This seems to suggest that this could be a potential issue, although I'm not too hopeful that this is the solution since your direct axios request seems to work fine.
Could you add the request options from above to your direct axios call and see if any of those cause the issue?
@stephanoparaskeva It's interesting that it works with axios directly. We do add additional request options to axios, so I'm wondering if one these causes an issue in a React Native environment:
To help debug this, could you try two things:
- Change localhost to an IP address. This seems to suggest that this could be a potential issue, although I'm not too hopeful that this is the solution since your direct axios request seems to work fine.
- Could you add the request options from above to your direct axios call and see if any of those cause the issue?
It's the data: {} that you're sending, via Axios
for GET
in React Native as this threw an error for me. When I was making my axios queries to figure out a temporary alternative for typesense-js by using normal requests.
Perhaps you could test with create-react-native-app + typesense + axios GET
with a data: {...}?
Maybe a cors error?
@stephanoparaskeva I've now updated the library to not send data
for GET requests:
Could you give it a shot now in React Native to see if it fixes the issue?
I know at least one user who's using Typesense with React Native, so closing this for now. Please feel free to re-open if this is still an issue.
I'm having this same issue on Android specifically. @stephanoparaskeva Were you able to find a solution for this?
Update: I was able to get it to connect by running adb reverse tcp:8108 tcp:8108
adb reverse tcp:8108 tcp:8108
Don't work it for me, i'm having the same issue on Android: WARN Request #1703095543420: Request to Node 0 failed due to "undefined Network Error" WARN Request #1703095543420: Sleeping for 0.1s and then retrying request... WARN Request #1703095543420: Request to Node 0 failed due to "undefined Network Error" WARN Request #1703095543420: Sleeping for 0.1s and then retrying request...
@walter-ayala I can help if you create a repo showcasing the issue that I can test
@walter-ayala I can help if you create a repo showcasing the issue that I can test
https://github.com/typesense/typesense-js/issues/189#issuecomment-1865244280 basically here would be everything related to the code of the project
i met same proplem and cant not resolve, can some one help?
// Results in Network Error --- (This exact request works fine on Node)
// Works fine
// Error
// Tried this with both Client and SearchClient
React Native Version 0.62 IOS, TypeSense 0.6.0