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

browser-run 2.6.0 broken #28

Open
neojski opened this issue Sep 17, 2015 · 12 comments
Open

browser-run 2.6.0 broken #28

neojski opened this issue Sep 17, 2015 · 12 comments

Comments

@neojski
Copy link

neojski commented Sep 17, 2015

It fails with:

Uncaught SyntaxError: Unexpected token o
SourceMapConsumer @ reporter.js:7159
mapSourcePosition @ reporter.js:8993
wrapCallSite @ reporter.js:9152
(anonymous function) @ reporter.js:9187
prepareStackTrace @ reporter.js:9186
window.onerror @ reporter.js:14

2.5.0 works

@juliangruber
Copy link
Owner

what browser is that in? can you also post a reproducible testcase?

@juliangruber
Copy link
Owner

the new version using electron fixes a lot of issues, this should be gone

@neojski
Copy link
Author

neojski commented Oct 31, 2015

Sorry, this still fails for me. I couldn't, however, create the small example because the small one works. Maybe it's some babelification issue. But maybe you'll be able to guess out of this:

    var sourceMap = aSourceMap;
    if (typeof aSourceMap === 'string') {
      sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
    }

This code fragment fails with aSourceMap === 'not supported'. It seems to me like browser-run expects source map and I'm not generating it and it fails to parse the aSourceMap

@juliangruber
Copy link
Owner

where is this snippet from?

@neojski
Copy link
Author

neojski commented Oct 31, 2015

It's from node_modules/browser-run/static/reporter.js.

@juliangruber
Copy link
Owner

and which browser are you using?

@neojski
Copy link
Author

neojski commented Oct 31, 2015

Chrome.

@juliangruber
Copy link
Owner

hmm, i can't find a way to reproduce unfortunately

@geekytime
Copy link

geekytime commented Aug 5, 2016

I was able to reproduce this in both Chrome and Electron:

  • Write a tape test with a failing assert
  • Bundle the test with webpack/babel
  • Run the test in any browser using tape-run
  • Browser and tape-run both hang

Successful tests work okay. It's only when an assertion fails or a test throws that the problem occurs.

It still seems to be a problem in 3.2.0.

I also get an additional error: Failed to parse SourceMap: http://localhost:64546/FromEventObservable.js.map. This is strange because I don't have source maps turned on in Webpack, and turning them on doesn't seem to help. 😕

@geekytime
Copy link

geekytime commented Aug 5, 2016

There seems to be some kind of race condition between tape and something that's getting set up inbrowser-run's reporter.js. If I put a setTimeout around the failing test to make it start a little later, everything works again, and I get the failing result. I can also "fix" it by setting a breakpoint on my failing assert in Chrome, slowing down the test.

Could the tape tests be throwing errors before source-map-support is finished sorting out the overall source map and call stack situation?

@juliangruber
Copy link
Owner

@geekytime great investigate work! can you post what you wrote to test this bug here?

@juliangruber juliangruber reopened this Aug 5, 2016
@geekytime
Copy link

geekytime commented Aug 9, 2016

My example was all bound up in my tests for my project, and then I went on vacation. 😄

I can take another look in the next few days, and see if I can whip up a small example project.

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

3 participants