Unhandled Promise Rejection: undefined
See original GitHub issueHey 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:
- Created 5 years ago
- Comments:8 (3 by maintainers)
Hello @enableds , thanks for the issue.
I’ll try to do some tests, is it possible that there are some CORS issue maybe?
@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 🤕