-
-
Notifications
You must be signed in to change notification settings - Fork 120
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
Unhandled Promise Rejection. Error.captureStackTrace #121
Comments
Could you share minimal reproducible code of your app? |
I'll try that, but it will take a while to get the minimal amount. At least a few days. |
I'm still working on it, but what I noticed is after starting the expo server after a while again the translate worked twice and then it gives the stacktrace error every time after, so I think it has something to do with caching in your code. |
@Kefir101 Is this error appears on app launch or after making actual call to translate()? async function parseTextBothWays(text) {
if (text) {
console.log(text);
let translated = await translate(text, { to: 'en' });
}
} And just as experiment, could you replace async function parseTextBothWays(text) {
if (text) {
console.log(text);
// let translated = await translate(text, { to: 'en' });
throw new Error('my error');
}
} |
@vitalets Error only appears when making the translate() call, but I noticed it now took 5-10 pictures to start giving the error, I think it has something to do with how much text has been translated already. Translating "" (empty) still gives the error, and replacing the translate() with throwing 'my error' leads to only seeing [Unhandled promise rejection: Error: my error]. |
@vitalets What do you think I should test out next? |
I've tried to reproduce it on https://github.com/Kefir101/Shortened-VeganChecker but was not able to run it.
I suppose this is because of Lets do the following:
|
@vitalets I was doing |
Yes, that helped! Now I'm getting error:
I see that |
Ah right, I’m using Google Vision which requires an API key so I hid it in the config file. But getting rid of that makes it hard to test, so I’m not sure how to proceed. I have gone on vacation so I will get back to this later, thank you so much for your help so far. |
I had to come back to this specific API because now I need the language found as well. Removing the api call makes the code works fine, so it has to be here.
Running for react-native and expo app on windows, all I'm doing is a simple call using the documentation (in an async function). React native 69.9, expo sdk 46, react 18. Not sure what else to put.
The text was updated successfully, but these errors were encountered: