in Angular 2 project written in typescript and packaged with webpack I add e.g. following throw to welcome.ts file:
@Page({
templateUrl: 'build/views/welcome/welcome.html'
})
export class Welcome{
constructor(){
throw('something went wrong')
}
}
In JS console, I see following error and stacktrace:
EXCEPTION: Error: Uncaught (in promise): EXCEPTION: Error during instantiation of Welcome!.
ORIGINAL EXCEPTION: something went wrong
ERROR CONTEXT:
[object Object]BrowserDomAdapter.logError @ browser_adapter.js?f9d6:77
BrowserDomAdapter.logGroup @ browser_adapter.js?f9d6:87
ExceptionHandler.call @ exception_handler.js?1ee2:57
(anonymous function) @ application_ref.js?7cf8:194
EventEmitter.subscribe.schedulerFn @ async.js?563f:123
SafeSubscriber.__tryOrUnsub @ VM2136:166SafeSubscriber.next @ VM2136:115
Subscriber._next @ VM2136:74Subscriber.next @ VM2136:51
Subject._finalNext @ VM2130:124Subject._next @ VM2130:116
Subject.next @ VM2130:73EventEmitter.emit @ async.js?563f:112
_a._zoneImpl.ng_zone_impl_1.NgZoneImpl.onError @ ng_zone.js?c886:120
_a.ier.ier.fork.onHandleError @ ng_zone_impl.js?4233:66
ZoneDelegate.handleError @ zone.js?fad3:327Zone.runGuarded @ zone.js?fad3:233
_loop_1 @ zone.js?fad3:487drainMicroTaskQueue @ zone.js?fad3:494cancelFn.invoke @ zone.js?fad3:426
browser_adapter.js?f9d6:77
STACKTRACE:BrowserDomAdapter.logError @ browser_adapter.js?f9d6:77
ExceptionHandler.call @ exception_handler.js?1ee2:59
(anonymous function) @ application_ref.js?7cf8:194
EventEmitter.subscribe.schedulerFn @ async.js?563f:123
SafeSubscriber.__tryOrUnsub @ VM2136:166SafeSubscriber.next @ VM2136:115
Subscriber._next @ VM2136:74
Subscriber.next @ VM2136:51
Subject._finalNext @ VM2130:124
Subject._next @ VM2130:116
Subject.next @ VM2130:73
EventEmitter.emit @ async.js?563f:112
_a._zoneImpl.ng_zone_impl_1.NgZoneImpl.onError @ ng_zone.js?c886:120_
a.ier.ier.fork.onHandleError @ ng_zone_impl.js?4233:66
ZoneDelegate.handleError @ zone.js?fad3:327
Zone.runGuarded @ zone.js?fad3:233
_loop_1 @ zone.js?fad3:487drainMicroTaskQueue @ zone.js?fad3:494
cancelFn.invoke @ zone.js?fad3:426
Is it possible to configure typescript compiler and webpack so that the stacktrace will also feature my welcome.ts file? e.g.:
constructor @ welcome.ts:7
So far I tried all the options in webpack devtool option and in tsconfig.js compilerOptions.sourceMap is set to true, but none helped.
