Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line lines reported are not mapped back to original code #84

Closed
mitar opened this issue Nov 24, 2018 · 4 comments
Closed

Line lines reported are not mapped back to original code #84

mitar opened this issue Nov 24, 2018 · 4 comments

Comments

@mitar
Copy link
Member

mitar commented Nov 24, 2018

Assertion like this:

I20181123-20:01:35.867(-8)?       AssertionError: expected { Object (type, content) } to deeply equal { Object (type, content) }
I20181123-20:01:35.868(-8)?       + expected - actual
I20181123-20:01:35.868(-8)? 
I20181123-20:01:35.868(-8)?            }
I20181123-20:01:35.869(-8)?            {
I20181123-20:01:35.869(-8)?              \"content\": [
I20181123-20:01:35.869(-8)?                {
I20181123-20:01:35.869(-8)?       -          \"text\": \"Test\"
I20181123-20:01:35.870(-8)?       +          \"text\": \"Test.\"
I20181123-20:01:35.870(-8)?                  \"type\": \"text\"
I20181123-20:01:35.870(-8)?                }
I20181123-20:01:35.870(-8)?              ]
I20181123-20:01:35.871(-8)?              \"type\": \"paragraph\"
I20181123-20:01:35.871(-8)?       
I20181123-20:01:35.871(-8)?       at Function.assert.deepEqual (packages/modules.js?hash=8cacc4b932a2fbbf2a33b8b74deabd9750c7c386:63680:32)
I20181123-20:01:35.871(-8)?       at Context._callee7$ (app/app.js?hash=3ad9fc511699e599f88739f3e613e310ca2e11c8:8758:24)
I20181123-20:01:35.871(-8)?       at tryCatch (packages/modules.js?hash=8cacc4b932a2fbbf2a33b8b74deabd9750c7c386:58690:40)
I20181123-20:01:35.872(-8)?       at Generator.invoke [as _invoke] (packages/modules.js?hash=8cacc4b932a2fbbf2a33b8b74deabd9750c7c386:58924:22)
I20181123-20:01:35.872(-8)?       at Generator.prototype.(anonymous function) [as next] (packages/modules.js?hash=8cacc4b932a2fbbf2a33b8b74deabd9750c7c386:58742:21)
I20181123-20:01:35.872(-8)?       at tryCatch (packages/modules.js?hash=8cacc4b932a2fbbf2a33b8b74deabd9750c7c386:58690:40)
I20181123-20:01:35.872(-8)?       at invoke (packages/modules.js?hash=8cacc4b932a2fbbf2a33b8b74deabd9750c7c386:58780:20)
I20181123-20:01:35.873(-8)?       at http://localhost:3100/packages/modules.js?hash=8cacc4b932a2fbbf2a33b8b74deabd9750c7c386:58790:13
I20181123-20:01:35.873(-8)?       at http://localhost:3100/packages/meteor.js?hash=c9a34f92f28ede5a42eac467d3fa1763b624436a:1168:22

Is not very useful. Because of babel and my using of async code, there is no way to really discover which assert failed in the code from:

app/app.js?hash=3ad9fc511699e599f88739f3e613e310ca2e11c8:8758:24

I would hope that this gets mapped to original source code locations.

I am using meteortesting:mocha@1.0.1.

@SimonSimCity
Copy link
Member

This problem is less related to this plugin but rather to how Meteor is handling the code. You'll get a similar call-stack when your Meteor app crashes.

Just some ideas to get further on ...
Does this only apply to client-side or also to server-side code?
Would using this plugin already help you? https://www.npmjs.com/package/source-map-support

@mitar
Copy link
Member Author

mitar commented Nov 24, 2018

Generally Meteor is pretty good at mapping back to lines, even for exceptions it shows. So I am not sure where this is breaking here?

I think this is something MDG could give some insight how to do or how they are doing? cc @benjamn

@SimonSimCity
Copy link
Member

I looked into it a bit more and found out that puppeteer (or also any other browser I've been looking into) does not apply source maps to the stack traces. puppeteer/puppeteer#985

If you ask me, this looks like a browser related problem. Until now I was not really successful in applying the proposed solutions like https://github.com/novocaine/sourcemapped-stacktrace or https://github.com/evanw/node-source-map-support.

It would maybe the right place to ask Meteor to add support for this. Another way would be if you'd write a reporter yourself which prints out the native exception to the console so the browser transforms the stack.

@SimonSimCity
Copy link
Member

Closing because it's off-topic for this package. This package just takes whatever the console of the browser reports and forwards it to the command-line. If the stack-trace is not how you'd like to have it, please report this on the repository of the meteor framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants