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
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);