stacktracejs / error-stack-parser

Extract meaning from JS Errors
https://www.stacktracejs.com/#!/docs/error-stack-parser
MIT License
458 stars 52 forks source link

Does not parse Node.js error.stack originating in webpack bundle #34

Open gajus opened 7 years ago

gajus commented 7 years ago

I am producing a webpack bundle and executing it using Node.js. There is an error originating in the bundle.

I have a source map. I want to parse the stack trace and apply the source map.

The following stack trace:

TypeError: __webpack_require__.i(...) is not a function
    at configureStore (isomorphic-webpack:1300:115)
    at Object../app/app.js (isomorphic-webpack:761:84)
    at __webpack_require__ (isomorphic-webpack:621:30)
    at fn (isomorphic-webpack:45:20)
    at resolveOverride (/Users/gajus/Documents/dev/gajus/react-boilerplate/node_modules/isomorphic-webpack/dist/factories/createIsomorphicWebpack.js:149:14)
    at Function._module2.default._load (/Users/gajus/Documents/dev/gajus/react-boilerplate/node_modules/isomorphic-webpack/node_modules/override-require/dist/overrideRequire.js:39:14)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at createCompilationPromise.then (/Users/gajus/Documents/dev/gajus/react-boilerplate/server/middlewares/frontendMiddleware.js:68:104)

Produces the following error:

/Users/gajus/Documents/dev/gajus/react-boilerplate/node_modules/isomorphic-webpack/node_modules/error-stack-parser/error-stack-parser.js:35
                throw new Error('Cannot parse given Error object');
                ^

Error: Cannot parse given Error object
    at ErrorStackParser$$parse (/Users/gajus/Documents/dev/gajus/react-boilerplate/node_modules/isomorphic-webpack/node_modules/error-stack-parser/error-stack-parser.js:35:23)
    at formatErrorStack (/Users/gajus/Documents/dev/gajus/react-boilerplate/node_modules/isomorphic-webpack/dist/factories/createIsomorphicWebpack.js:200:22)
    at process.on (/Users/gajus/Documents/dev/gajus/react-boilerplate/server/middlewares/frontendMiddleware.js:42:59)
    at emitTwo (events.js:106:13)
    at process.emit (events.js:191:7)
    at processEmit [as emit] (/Users/gajus/Documents/dev/gajus/react-boilerplate/node_modules/fsevents/node_modules/signal-exit/index.js:155:32)
    at emitPendingUnhandledRejections (internal/process/promises.js:85:22)
    at runMicrotasksCallback (internal/process/next_tick.js:61:9)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Your Environment

adventurist commented 6 years ago

Interesting! Any recent development on this? I haven't had any issues using error-stack-parser inside of a webpack bundle, but I have been trying to parse objects inheriting from Error, and that results in the same error message.