Stacktrace not using sourcemap in ionic cordova app


#1

Hi,
I am using https://www.stacktracejs.com/ to get stacktrace when error occurs. It works well on chrome and uses sourcemap file to get correct file and line number where error occured but it provides minified file stacktrace when its running inside cordova. Any idea how to make sourcemap working in cordova?

  function log(exception, cause) {
    $log.error.apply($log, arguments);
    try {
        var stackTrace,
            http = $injector.get('$http'),
            requestData;
        stackTrace = StackTrace.fromError(exception).then(function (stackframes) {
            var stringifiedStack = stackframes.map(function (sf) {
                return sf.toString();
            }).join('\n');
            requestData = {
                exception: JSON.stringify(exception),
                stack: exception.stack,
                description: exception.description || exception.message,
                stacktrace: stringifiedStack,
                cookies: getCookies(),
                userAgentInfo: getUserSystemInfo(),
                localStorageData: getLocalStorageData(),
                date: new Date()
            };
            showErrorDialog(requestData);
        });
    } catch (loggingError) {
        $log.warn("Error logging failed:" + loggingError);
    }
}