If a stack trace includes the generated line code, then getOriginalPosition (dependency of formatErrorStack) will fail with an error:
TypeError: Cannot read property 'replace' of null
at getOriginalPosition (/node_modules/isomorphic-webpack/dist/factories/createIsomorphicWebpack.js:103:38)
at errorStack.replace (/node_modules/isomorphic-webpack/dist/factories/createIsomorphicWebpack.js:111:32)
at RegExp.[Symbol.replace] (native)
at RegExp.[Symbol.replace] (native)
at String.replace (native)
at formatErrorStack (/node_modules/isomorphic-webpack/dist/factories/createIsomorphicWebpack.js:110:23)
at /src/bin/server.js:66:17
at Layer.handle_error (/node_modules/router/lib/layer.js:69:5)
at trim_prefix (/node_modules/router/index.js:327:13)
at /node_modules/router/index.js:293:7
Expected behaviour
Stack trace must refer to the original code executed in the VM.
Current behaviour
A code fragment thats generated during the compilation step causes an error when formatting erro stack trace using
formatErrorStack
, e.g.The following code fragment:
when compiled using babel-plugin-tcomb gets convered to (pseudo code):
If a stack trace includes the generated line code, then
getOriginalPosition
(dependency offormatErrorStack
) will fail with an error:Expected behaviour
Stack trace must refer to the original code executed in the VM.