Closed bodokaiser closed 10 years ago
The "(while aliasify was processing..." is added right before we call emit here:
https://github.com/benbria/browserify-transform-tools/blob/master/src/transformTools.coffee#L76
What do you mean by getting an error event on the builder?
For example here browserify emits an error event. This allows using something like:
app.use(function(req, res, next) {
var builder = browserify();
var writer = getFileStream();
builder.on('error', next);
writer.on('finish', next);
});
in development mode I then would get a http 500 response and can easily fix the typo else I always have to restart the daemon as node crashes (which is not so nice if there should be an error in production).
I added this unit test and this unit test, and both pass the way I'd expect them to.
I started working on a unit test that actually uses browserify (and found a bug in the latest browserify :P), but I found I'd get the error in the bundle() callback, but not in my error handler. I notice that the browserify docs don't mention an error event, although you plainly found one in the source. :/
That code example you gave me isn't complete, yes? I mean, I don't see where you actually call into browserify... Do you have a more complete example I can try out?
I found my mistake: The error event is emitted on the stream which is returned by bundle()
not on browserify()
itself ^^
Sry should have tried this before...
No worries. It forced me to write some more unit tests, which isn't a bad thing. ;) On Dec 29, 2013 9:33 AM, "Bodo Kaiser" notifications@github.com wrote:
I found my mistake: The error event is emitted on the stream which is returned by bundle() not on browserify() itself ^^
Sry should have tried this before...
— Reply to this email directly or view it on GitHubhttps://github.com/benbria/browserify-transform-tools/issues/2#issuecomment-31317964 .
Glad it was not totally useless though its generally a bad thing searching mistakes at others :)
However think this was the last time :p
Am 29.12.2013 um 15:46 schrieb Jason Walton notifications@github.com:
No worries. It forced me to write some more unit tests, which isn't a bad thing. ;) On Dec 29, 2013 9:33 AM, "Bodo Kaiser" notifications@github.com wrote:
I found my mistake: The error event is emitted on the stream which is returned by bundle() not on browserify() itself ^^
Sry should have tried this before...
— Reply to this email directly or view it on GitHubhttps://github.com/benbria/browserify-transform-tools/issues/2#issuecomment-31317964 .
— Reply to this email directly or view it on GitHub.
I think you forget to emit an error event somewhere (may be somewhere here?)[https://github.com/benbria/browserify-transform-tools/blob/master/src/transformTools.coffee#L157] .
At least my node process crashes when having a syntax error whereas I get an
error
event on the builder to handle.