I believe there is a bug in line 6438 of the purecloud-platform-client-v2.min.js in the following chunk:
}, {
key: "log",
value: function log(level, statusCode, method, url, requestHeaders, responseHeaders, requestBody, responseBody) {
var content = this.formatLog(level, statusCode, method, url, requestHeaders, responseHeaders, requestBody, responseBody);
if (typeof window !== 'undefined') {
var shouldLog = this.calculateLogLevel(level);
if (shouldLog > 0 && this.log_to_console === true) {
if (this.log_format === this.logFormatEnum.formats.JSON) {
console.log(content);
} else {
console.log("".concat(level.toUpperCase(), ": ").concat(content));
}
}
} else {
if (this.logger.transports.length > 0)
this.log(level, content);
}
}
The this
is already a Logger
object and hence this.logger
is undefined. The fix that works for me is
if (this.logger?.transports?.length > 0)
but it is probably not the way you'd like to fix the issue.