Asp.Net Bundling with source map for Correct Error Logging.
In BundleConfig.cs use ScriptWithSourceMapBundle
:
bundles.Add(new ScriptWithSourceMapBundle("~/Scripts/app").Include(
"~/Scripts/log.js",
"~/Scripts/app.js"));
In js error logging:
window.onerror = function (msg, url, line, col, error) {
var callback = function(stackframes) {
// proccess stackFrames:
// [{columnNumber: 5, fileName: "https://domain.com/Scripts/app.js", functionName:"action", lineNumber:9}]
console.log(stackframes);
};
StackTrace.fromError(error).then(callback);
return true;
};
Correct row and column position from original source code.