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 when configuring new provider

See original GitHub issue

Getting the following when trying to configure a new provider:

    const manager = new OAuthManager('monzo-categories')
    manager.addProvider({
      monzo: {
          auth_version: '2.0',
          authorize_url: 'https://auth.getmondo.co.uk',
          access_token_url: 'https://api.monzo.com/oauth2/token',
          callback_url: ({app_name}) => `${app_name}://oauth`,
      }
    });
    manager.configure({
      monzo: {
        client_id: 'test',
        client_secret: 'test'
      }
    });

Stack trace:

[Unhandled promise rejection: TypeError: undefined is not an object (evaluating 'Module[fn]')]
- node_modules/react-native-oauth/lib/promisify.js:11:44 in <unknown>
- node_modules/promise/setimmediate/core.js:45:7 in tryCallTwo
- node_modules/promise/setimmediate/core.js:200:23 in doResolve
- node_modules/promise/setimmediate/core.js:66:12 in Promise
- node_modules/react-native-oauth/lib/promisify.js:6:21 in <unknown>
- node_modules/react-native-oauth/react-native-oauth.js:141:42 in configureProvider
- node_modules/react-native-oauth/react-native-oauth.js:149:37 in <unknown>
- node_modules/react-native-oauth/react-native-oauth.js:148:17 in configureProviders
- node_modules/react-native-oauth/react-native-oauth.js:37:35 in configure
* js/HomeScreen.js:24:22 in initAuthentication
- node_modules/react-proxy/modules/createPrototypeProxy.js:44:35 in proxiedMethod
* js/HomeScreen.js:42:25 in onPress
- node_modules/react-native/Libraries/Components/Touchable/TouchableNativeFeedback.android.js:170:45 in touchableHandlePress
- node_modules/react-native/Libraries/Components/Touchable/Touchable.js:746:34 in _performSideEffectsForTransition
- ... 24 more stack frames from framework internals

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9

github_iconTop GitHub Comments

2reactions
conejerockcommented, Oct 9, 2018

You must handle the Promise that return configure:

 manager.configure({
      monzo: {
        client_id: 'test',
        client_secret: 'test'
      }
})
.then(function (data) {
      console.log("Promise Resolved:"+data);
})
.catch(function (err) {
      console.log("Promise Rejected:"+err);
});
0reactions
g12mcgovcommented, Nov 21, 2018

Anyone find a solution to this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unhandled Promise rejection: No provider for HTTPService
I am migrating my app to the latest RC and am getting some errors that I cannot fix. Before deciding to ask here...
Read more >
Unhandled promise rejection (rejection id: 1): TypeError ...
Help, I kept getting UnhandledPromiseRejectionWarning: Unhandled promise ... inside the config xml <widget> element and specify a new package name for the ...
Read more >
Handling those unhandled promise rejections with JS async ...
You put your code inside an async function in order to use await calls; One of your await ed functions fails (i.e. rejects...
Read more >
Unhandled promise rejection - Ethereum Stack Exchange
D applications? ... I installed a new outlet and tripped the whole power panel... Does a 30 amp circuit need special outlets? How...
Read more >
Error Messages | Cypress Documentation
Cypress detected that you returned a promise in a test, but also invoked one or more cy ... The supportFile configuration option was...
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