I'm using the paypal button with checkout.js inside an angular 4 app. When the payment component initialises it loads in the checkout.js script, then creates the button. Everything works as expected, apart from if I move away from the component whilst the paypal button is initialising, then i get the following error:
ppxo_unhandled_error from logger.js
and then
Uncaught Error: Detected close during init from subscriber.js
See http://i.imgur.com/B4JhLTg.png for screenshot of error
I just want to handle the error and probably just ignore it, but my global error handler is picking it up :/
Any ideas?
As above, cannot provider repo or plunker etc, sorry.
I am getting a similar error. It isn't calling the onAuthorize. Any help I am pretty stuck at this point...
Object {stack: "Error: Detected close during init at eval (web…/~/paypal-checkout/dist/checkout.lib.js?:1302:32)", errtype: "[object Error]", timestamp: 1502390905846, windowID: "0b6d2a91bd", pageID: "65c3666459"}errtype: "[object Error]"pageID: "65c3666459"stack: "Error: Detected close during init↵ at eval (webpack:///./~/paypal-checkout/dist/checkout.lib.js?:5353:88)↵ at check (webpack:///./~/paypal-checkout/dist/checkout.lib.js?:1302:32)"timestamp: 1502390905846windowID: "0b6d2a91bd"__proto__: Objectconstructor: function Object()hasOwnProperty: function hasOwnProperty()isPrototypeOf: function isPrototypeOf()propertyIsEnumerable: function propertyIsEnumerable()toLocaleString: function toLocaleString()toString: function toString()valueOf: function valueOf()__defineGetter__: function __defineGetter__()__defineSetter__: function __defineSetter__()__lookupGetter__: function __lookupGetter__()__lookupSetter__: function __lookupSetter__()get __proto__: function __proto__()set __proto__: function __proto__()
print @ checkout.lib.js:326
log @ checkout.lib.js:419
error @ checkout.lib.js:454
(anonymous) @ checkout.lib.js:12431
dispatchPossiblyUnhandledError @ checkout.lib.js:7604
(anonymous) @ checkout.lib.js:7683
checkout.lib.js:5353 Uncaught Error: Detected close during init
at eval (checkout.lib.js:5353)
at check (checkout.lib.js:1302)
(anonymous) @ checkout.lib.js:5353
check @ checkout.lib.js:1302
HERE IS MORE OF THE STACK TRACE:
| (anonymous) | @ | VM67619 checkout.4.0.103.js:676
-- | -- | -- | --
| ZalgoPromise | @ | VM67619 checkout.4.0.103.js:7644
| ajax | @ | VM67619 checkout.4.0.103.js:660
| transport | @ | VM67619 checkout.4.0.103.js:514
| immediateFlush | @ | VM67619 checkout.4.0.103.js:368
| (anonymous) | @ | VM67619 checkout.4.0.103.js:194
| destroyElement | @ | checkout.lib.js:6909
| (anonymous) | @ | checkout.lib.js:4765
| run | @ | checkout.lib.js:3538
| all | @ | checkout.lib.js:3551
| (anonymous) | @ | checkout.lib.js:5622
| ZalgoPromise.try | @ | checkout.lib.js:7790
| ParentComponent.destroy | @ | checkout.lib.js:5618
| (anonymous) | @ | checkout.lib.js:5642
| ZalgoPromise.try | @ | checkout.lib.js:7790
| ParentComponent.error | @ | checkout.lib.js:5640
| ZalgoPromise.try | @ | checkout.lib.js:7790
| error:promisified | @ | checkout.lib.js:6511
| (anonymous) | @ | checkout.lib.js:8427
| (anonymous) | @ | checkout.lib.js:7710
| ZalgoPromise.dispatch | @ | checkout.lib.js:7724
| ZalgoPromise.then | @ | checkout.lib.js:7740
| ZalgoPromise.catch | @ | checkout.lib.js:7744
| (anonymous) | @ | checkout.lib.js:8426
| value | @ | checkout.lib.js:5734
| (anonymous) | @ | checkout.lib.js:3049
| ZalgoPromise.try | @ | checkout.lib.js:7790
| (anonymous) | @ | checkout.lib.js:3048
| (anonymous) | @ | checkout.lib.js:2537
| ZalgoPromise.try | @ | checkout.lib.js:7790
| _RECEIVE_MESSAGE_TYPE.(anonymous function) | @ | checkout.lib.js:2533
| receiveMessage | @ | checkout.lib.js:2466
| messageListener | @ | checkout.lib.js:2487
| postMessage (async) | |
| (anonymous) | @ | VM67619 checkout.4.0.103.js:2654
| SEND_MESSAGE_STRATEGIES.(anonymous function) | @ | VM67619 checkout.4.0.103.js:2653
| (anonymous) | @ | VM67619 checkout.4.0.103.js:2607
| ZalgoPromise.try | @ | VM67619 checkout.4.0.103.js:7789
| (anonymous) | @ | VM67619 checkout.4.0.103.js:2605
| (anonymous) | @ | VM67619 checkout.4.0.103.js:3068
| ZalgoPromise.try | @ | VM67619 checkout.4.0.103.js:7789
| (anonymous) | @ | VM67619 checkout.4.0.103.js:3067
| promiseMap | @ | VM67619 checkout.4.0.103.js:3070
| (anonymous) | @ | VM67619 checkout.4.0.103.js:2604
| ZalgoPromise.try | @ | VM67619 checkout.4.0.103.js:7789
| sendMessage | @ | VM67619 checkout.4.0.103.js:2589
| (anonymous) | @ | VM67619 checkout.4.0.103.js:3285
| ZalgoPromise | @ | VM67619 checkout.4.0.103.js:7644
| (anonymous) | @ | VM67619 checkout.4.0.103.js:3271
| (anonymous) | @ | VM67619 checkout.4.0.103.js:7699
| ZalgoPromise.dispatch | @ | VM67619 checkout.4.0.103.js:7723
| ZalgoPromise.then | @ | VM67619 checkout.4.0.103.js:7739
| (anonymous) | @ | VM67619 checkout.4.0.103.js:3270
| ZalgoPromise.try | @ | VM67619 checkout.4.0.103.js:7789
| request | @ | VM67619 checkout.4.0.103.js:3245
| _send | @ | VM67619 checkout.4.0.103.js:3323
| wrapper | @ | VM67619 checkout.4.0.103.js:2993
| onAuthorize | @ | VM67623 button.js?build=2.0.2_20170807201647678.unx:4190
| props.(anonymous function) | @ | VM67619 checkout.4.0.103.js:8578
| (anonymous) | @ | VM67619 checkout.4.0.103.js:9092
| (anonymous) | @ | VM67619 checkout.4.0.103.js:7699
| ZalgoPromise.dispatch | @ | VM67619 checkout.4.0.103.js:7723
| ZalgoPromise.then | @ | VM67619 checkout.4.0.103.js:7739
| (anonymous) | @ | VM67619 checkout.4.0.103.js:9091
| value | @ | VM67619 checkout.4.0.103.js:5733
| (anonymous) | @ | VM67619 checkout.4.0.103.js:7107
| (anonymous) | @ | VM67619 checkout.4.0.103.js:3048
| ZalgoPromise.try | @ | VM67619 checkout.4.0.103.js:7789
| (anonymous) | @ | VM67619 checkout.4.0.103.js:3047
| (anonymous) | @ | VM67619 checkout.4.0.103.js:2536
| ZalgoPromise.try | @ | VM67619 checkout.4.0.103.js:7789
| _RECEIVE_MESSAGE_TYPE.(anonymous function) | @ | VM67619 checkout.4.0.103.js:2532
| receiveMessage | @ | VM67619 checkout.4.0.103.js:2465
| __WEBPACK_IMPORTED_MODULE_4__global__.a.receiveMessage | @ | VM67619 checkout.4.0.103.js:1890
| SEND_MESSAGE_STRATEGIES.(anonymous function) | @ | VM67619 checkout.4.0.103.js:2668
| (anonymous) | @ | VM67619 checkout.4.0.103.js:2607
| ZalgoPromise.try | @ | VM67619 checkout.4.0.103.js:7789
| (anonymous) | @ | VM67619 checkout.4.0.103.js:2605
| (anonymous) | @ | VM67619 checkout.4.0.103.js:3068
| ZalgoPromise.try | @ | VM67619 checkout.4.0.103.js:7789
| (anonymous) | @ | VM67619 checkout.4.0.103.js:3067
| promiseMap | @ | VM67619 checkout.4.0.103.js:3070
| (anonymous) | @ | VM67619 checkout.4.0.103.js:2604
| ZalgoPromise.try | @ | VM67619 checkout.4.0.103.js:7789
| sendMessage | @ | VM67619 checkout.4.0.103.js:2589
| (anonymous) | @ | VM67619 checkout.4.0.103.js:3285
| ZalgoPromise | @ | VM67619 checkout.4.0.103.js:7644
| (anonymous) | @ | VM67619 checkout.4.0.103.js:3271
| (anonymous) | @ | VM67619 checkout.4.0.103.js:7699
| ZalgoPromise.dispatch | @ | VM67619 checkout.4.0.103.js:7723
| ZalgoPromise.then | @ | VM67619 checkout.4.0.103.js:7739
| (anonymous) | @ | VM67619 checkout.4.0.103.js:3270
| ZalgoPromise.try | @ | VM67619 checkout.4.0.103.js:7789
| request | @ | VM67619 checkout.4.0.103.js:3245
| _send | @ | VM67619 checkout.4.0.103.js:3323
| wrapper | @ | VM67619 checkout.4.0.103.js:2993
| (anonymous) | @ | www.sandbox.paypal.com/webapps/hermes/static/js/main.js:31191
| (anonymous) | @ | www.paypalobjects.com/js/xo/hermes/1.1.0/framework.js:7305
| $eval | @ | www.paypalobjects.com/js/xo/hermes/1.1.0/framework.js:7660
| $digest | @ | www.paypalobjects.com/js/xo/hermes/1.1.0/framework.js:7608
| (anonymous) | @ | www.paypalobjects.com/js/xo/hermes/1.1.0/framework.js:7664
| e | @ | www.paypalobjects.com/js/xo/hermes/1.1.0/framework.js:5416
| (anonymous) | @ | www.paypalobjects.com/js/xo/hermes/1.1.0/framework.js:5506
```
@stevedeighton -- yeah, this is something we need to consider. Sometimes the iframe being destroyed during init is an error case, sometimes it's legitimate (like in your case, changing view during render.) I'm leaning in the direction of just removing this error.
@jsgphd can you elaborate on your use case? Ideally please raise a separate issue with steps to reproduce.
OK, this error is removed. Will go out with the next push.
Fix pushed. Please clear your cache, and let me know if you still see the issue.
Seems to have worked, thanks!
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.