Greetings to all who come across this message. I am currently developing an app using Ionic2 where users can send image data to the server. If the server successfully receives the data, a confirmation message is displayed; otherwise, an error notification is shown.
The problem I'm facing is that despite receiving the image data in full and it displaying correctly on the server, Ionic/Typescript indicates an error when sending the data.
It is crucial for me to receive confirmation from the client that the information has been received accurately so that I can present it to the user.
Here is the relevant code snippet:
return new Promise((resolve, reject)=>{
this.http.get(url).map(res=>res.json()).subscribe(data=>{
console.log('InvoiceHttp.send() success!');
resolve(data);
}, err=>{
console.log('Http error on InvoiceHttp.send()');
console.error(err);
});
});
Upon running this function, I see both the success and error messages in the console. However, the error message points to the following:
ERROR: {"line":78889,"column":39,"sourceURL":"file:///var/containers/Bundle/Application/601C2294-78EA-48A2-9BAC-B53C04ADD458/MyApp.app/www/build/main.js"}
Investigating further, I noticed that this line leads to the MapSubscriber definition, hinting at a possible issue with .subscribe().
Initially, I considered that the server's response might not be in proper JSON format. Even after changing the response to blank or {}, the error persists, leaving me puzzled about its cause.
I appreciate any responses or insights shared on this matter.