question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unhandled Promise Rejection on iOS Simulator

See original GitHub issue

Describe the bug I’m just running BLEClient.initialize().then(() => bleAvailable=true).catch(() => bleAvailable = false), it works on the web and on iOS device, but on the iOS simulator, the call fails, but it also generate this error, and then the whole app “hangs” (router doesn’t work, etc)

image

To Reproduce Steps to reproduce the behavior:

  1. Call the code above
  2. Run it on the iOS simulator (I’m using iPhone 11, iOS 15)
  3. Debug error using Safari > Develop > Simulator > (Choose your app)
  4. See error

Expected behavior The initialize should just throw an error which is caught in the .catch and not have the application stop working correctly

Plugin version:

Desktop (please complete the following information):

  • OS: osX
  • iOS simulator (iPhone 11, iOS 15)

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
maelpcommented, Nov 28, 2021

Ok for some reason now the code works 😃 Thanks

0reactions
pwespicommented, Nov 27, 2021

Have you tried my code? Does it work?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting ['Unhandled Promise Rejection: Error: No matching ...
My simulator is running android 11. This works fine on iOS btw so I know it's something to do with android; possibly even...
Read more >
[BUG REPORT][iOS] ImagePicker throwing an "Unhandled ...
I was trying to do something last night by saving the value returned from the image picker into a screen variable, and was...
Read more >
KeepAwake - Expo Documentation
suppressDeactivateWarnings Optional - The call will throw an unhandled promise rejection on Android when the original Activity is dead or deactivated.
Read more >
Icons won't display - React Native - Code with Mosh Forum
In ios simulator I see “Possible Unhandled Promise Rejection (id:0):”. but not sure if that's related. The log for it is
Read more >
[Solved]-"Unhandled Promise Rejection: NotAllowedError
[Solved]-"Unhandled Promise Rejection: NotAllowedError: The request is not allowed by the user agent or the platform in the current context .." with PWA...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found