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: undefined

See original GitHub issue

Hey there! First off, great script man, hats off it’s just brilliant! I am however getting an error.

I’m using this on a mobile app, compiled using PhoneGap and Cordova ( actually, I get the same error when adding the page to the homescreen of my iOS device in WebView )

Animations don’t fire, buttons basically work just like regular anchors.

The code I use is this

`$(document).ready(function(){
‘use strict’

function init_template(){
     //Reinit Page Functions on Next Page           
}
init_template();
    

var FadeTransition = Barba.BaseTransition.extend({
  start: function() {
    Promise
      .all([this.newContainerLoading, this.fadeOut()])
      .then(this.fadeIn.bind(this));
  },
    fadeOut: function () {
        $('.page-container').addClass('disable-clicks');
        return $(this.oldContainer).promise();
    },
    fadeIn: function () {
        var _this = this;
        setTimeout(function(){
            $('.page-container:last').addClass('entering-container disable-clicks');
            $('.preloader').addClass('preloader-active');
        },100)
        setTimeout(function(){
            _this.done();
            init_template();
            $('.page-container').removeClass('entering-container disable-clicks');
            $('.preloader').removeClass('preloader-active');
        },500);
    }
});
Barba.Pjax.getTransition = function () {return FadeTransition;};
Barba.Pjax.start();

}); `

I’ve renamed barba container and wrapper to page-wrapper and page-container, but those work flawlessly. The thing is I get a strange error.

** Unhandled Promise Rejection: undefined (anonymous function) promiseRejectionJob **

It works great on Android Chrome Browser, iOS Chrome Browser, but when using in Webview, it’s pretty much dead.

Looking forward to your thoughts. PS: Here’s a video of the bug in action: https://www.youtube.com/watch?v=sh3ltKacx3M I showed it browser/in webview and the error as wel. I can’t get to the bottom of it.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lurukecommented, Oct 23, 2018

Hello @enableds , thanks for the issue.

I’ll try to do some tests, is it possible that there are some CORS issue maybe?

0reactions
enabledscommented, Nov 8, 2018

@luruke , I can send you a zip file with the Cordova app using your demo to see the issue. Maybe you can diagnose it. I’ve added whitelists and everything needed, but still, the “Unhandled Promise Rejection: undefined” is happening. This is a barba.js plugin error…

The funny part is. It works as a PWA, it works on Android as an APK ( built with the exact same Cordova settings), it works as a Website, it works when you add it to the home screen but, it doesn’t work on iOS when built with Cordova ( does work on Android, same settings )

I’m lost. Been trying to figure this out for weeks now 🤕

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is an unhandled promise rejection? - Stack Overflow
A rejected promise is like an exception that bubbles up towards the application entry point and causes the root error handler to produce...
Read more >
Handling those unhandled promise rejections with JS async ...
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was ......
Read more >
Tracking Unhandled Promise Rejections - TrackJS
When a promise is rejected, it looks for a rejection handler. If it finds one, like in the example above, it calls the...
Read more >
Unhandled Promise Rejection Warning - Codecademy Forums
The unhandledRejection event is emitted whenever a promise rejection is not handled. “Rejection” is the canonical term for a promise reporting ...
Read more >
Unhandled Promise rejection while working with Angular 5
Unhandled Promise rejection : Unable to get property 'schedule' of undefined or null reference ; Zone: <root> ; Task: Promise.then ; Value: TypeError:...
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