4

I'm trying to use stacktrace.js to report errors, but the path in the stack trace is referencing "ng:///FormModule/MyComponent.ngfactory.js"

    TypeError: Cannot read property 'push' of undefined
    at Object.eval [as handleEvent] (ng:///FormModule/MyComponent.ngfactory.js:668:41)
    at handleEvent (http://localhost/dist/form/angular-vendor.bundle.js:12204:138)
    at callWithDebugContext (http://localhost/dist/form/angular-vendor.bundle.js:13665:42)
    at Object.debugHandleEvent [as handleEvent] (http://localhost/dist/form/angular-vendor.bundle.js:13253:12)
    at dispatchEvent (http://localhost/dist/form/angular-vendor.bundle.js:8808:21)
    at http://localhost/dist/form/angular-vendor.bundle.js:9419:20
    at HTMLAnchorElement.<anonymous> (http://localhost/dist/form/angular-vendor.bundle.js:29309:53)
    at ZoneDelegate.invokeTask (http://localhost/dist/form/polyfills.bundle.js:7779:31)
    at Object.onInvokeTask (http://localhost/dist/form/angular-vendor.bundle.js:4090:33)
    at ZoneDelegate.invokeTask (http://localhost/dist/form/polyfills.bundle.js:7778:36)
    at Zone.runTask (http://localhost/dist/form/polyfills.bundle.js:7546:47)
    at HTMLAnchorElement.ZoneTask.invoke (http://localhost/dist/form/polyfills.bundle.js:7841:38)

Stacktrace.js cannot locate the bundle file and it's corresponding source map because this path cannot be loaded

XMLHttpRequest cannot load ng:///FormModule/MyComponent.ngfactory.js. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

Is anyone using WebPack, Stacktrace.js and getting the source maps to work, or does anyone know how to fix this issue?

1 Answer 1

1

Fixed a similar issue in an Angular 6 project by passing {offline: true} as the second argument to StackTrace.fromError method as follows:

StackTrace.fromError(error, {offline: true}).then(...

As suggested here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.