Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error with fetch #303

Open
xStranged1 opened this issue Nov 6, 2024 · 1 comment
Open

error with fetch #303

xStranged1 opened this issue Nov 6, 2024 · 1 comment

Comments

@xStranged1
Copy link

idk why, in my expo react native app "expo": "~51.0.28", this library breaks fetch

try {
const res = await fetch(API_URL + '/auth/login', options);
if (res.status == 200) {
// do something
}
return { errorHttp: res.status }
} catch (error) {
console.log(error) // LOG [TypeError: fetch is not a function (it is false)]
return { errorHttp: 500 }
}

After uninstall, works normally

@tsamaya
Copy link
Owner

tsamaya commented Nov 7, 2024

Hi

Thank you for raising the issue.

I spotted this from an Opencage's friend using expo: https://learnetto.com/tutorials/react-native-geocoder.

The issue comes with one of my library's dependencies. The workaround with the debug model can help.

Anyway, I would recommend switching to the next version: https://www.npmjs.com/package/opencage-api-client/v/2.0.0-alpha.3

This new version does not depend on crossfetch.
I have not released this version yet since it needs more type definitions.

Please let me know how it goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants