Ionic capacitor Error on Api / Http Call - cap.nativePromise

Hi All

I have created a capacitor app, where am trying to call javascripts before my app root loads, but, after it loads, it gives cap.nativePromise is not a function, whenever I give any api call, and api call fails after some time giving “timeout” error, any solution for this?

I am using latest version of ionic v6 with capacitor and angular 14

Hi,

is this resolved? I am also facing same issue. it is working as expected in android/chrome/safari but not working in ios device

@Dave-01 : are you able to resolve this issue? if yes, could you please share details. I am stuck on this since last couple of weeks now

No, was not able to, but by further analysis I found the issue is with angular, it does not get executed.

angular ui gets initiated but internal like main.js, ployfill.js and others does not gets executed afterwards.

Hi,

we have found out the issue. in our case issues was with Jquery call. we were making XHR call and was loading file with element based on certain condition. whe we debugged we found that document.open/document.write/document.close was throwing error as “SyntaxError: duplicate variable NativeBridge”.

we changed all references for document.open/document.write/document.close with
$(document.xxx).append(). in our case it was $(document.body).append(data);

hope this helps you too