In my TypeScript code, I encountered a peculiar issue with a jQuery promise. The fail() function is being executed immediately, logging an error message to the console, despite the promise resolving successfully afterwards. Here is the code snippet:
this.jQuery.getJSON(this.options.searchUrl, queryFilter)
.done(this.orderLinesCallback)
.fail(console.log("Error on retrieving orders"));