browser-run 2.6.0 broken
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
what browser is that in? can you also post a reproducible testcase?
the new version using electron fixes a lot of issues, this should be gone
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
where is this snippet from?
It's from node_modules/browser-run/static/reporter.js.
and which browser are you using?
Chrome.
hmm, i can't find a way to reproduce unfortunately
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. :confused:
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?
@geekytime great investigate work! can you post what you wrote to test this bug here?
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.