mini_racer: Meaningful errors with inlined sourcemaps
Hi
I’m using webpack to compile a server side js bundle with inlined sourcemaps, used to render server side views. Everything’s going well except errors. The stack trace given back is reasonable, eg:
ExecJS::ProgramError - ReferenceError: func is not defined:
Widget.vtree (eval at <anonymous> ((execjs):357:in `'
Widget.render (eval at <anonymous> ((execjs):391:in `'
Object.render (eval at <anonymous> ((execjs):1379:in `'
This error is okay, i can follow it from the entry point but I don’t get a strong gauge on which line in which file, which would be available in chrome, for example.
Is there a way to do that, to get more specific information about which line and which file is causing the exception?
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 18 (3 by maintainers)
Source maps are working well for me now. here’s what i did:
now, somewhere in your js:
This works with a fairly advanced webpack setup flawlessly.
-duh- okay, sorry that makes perfect sense. The
requireis translated by webpack and the npm package will patchError.prototype(or something like that).So technically no webpack is required and you could simply “eval” source-map-support, attach
readSourceMapand then eval your script - at least if I understand this correctly.V8 does not implement any source map logic, the logic all exists in the inspector which is a javascript package from what I can tell.
On Fri, Jun 2, 2017 at 10:54 PM, siassaj notifications@github.com wrote:
@ignisf tried to make that work but it was futile