Open mbernath opened 10 years ago
I'm not entirely sure if this is a grunt-browserify issue, a grunt-mocha-test issue, or a grunt issue. grunt-concurrent might solve the issue...
I'm also not entirely sure but I have a similar problem but with grunt-mocha-test and grunt-contrib-compress involved so it might be a grunt-mocha-test issue. My dependencies:
"devDependencies": {
"grunt": "0.4.x",
"grunt-contrib-compress": "^0.13.0",
"grunt-mocha-test": "0.12.x"
I can run the compress and test tasks seperately but not in sequence test->compress. It's also working the other way around. The problem occurs in node 0.10.38 and in node 0.12.3.
Everything is quiet but the compression never terminates. I do not have a stacktrace but when using DEBUG I found a similar Exception.
Running "compress:dist" (compress) task
[D] Task source: .../node_modules/grunt-contrib-compress/tasks/compress.js
Verifying property compress.dist exists in config...OK
Options: archive="build/artefact.tgz", mode="tgz", level=1
mocha:runner uncaught exception Cannot read property 'ended' of undefined +12ms
Your workaround using clearRequireCache: false
did work as well.
Hi there,
here is a presumably rare but nasty bug and its workaround, that cost me the last couple of hours. The bug only occurs when grunt-mocha-test and grunt-browserify are run together in one project. This set-up might not be too rare, though.
I'm wondering where to file this issue - either here or with grunt-mocha-test. So any advice is appreciated.
Steps to reproduce
Run grunt-mocha-test and grunt-browserify in a row with a configuration like this (first grunt-mocha-test, then grunt-browserify):
This produces the following error, when grunt runs grunt-browserify:
The error does not occur, when grunt-mocha-test and grunt-browserify are run with separately like this:
This is how far I could nail down the error...
Workaround
I tried to workaround with many versions of grunt, grunt-browserify and grunt-mocha-test, but the only working solution was to set one mochaTest option to false:
clearRequireCache: false
. Then everything works as expected.Configuration
Here are the relevant dependencies with which I could reproduce the error on node version 0.10.28: