Coder Social home page Coder Social logo

Comments (7)

jwalton avatar jwalton commented on May 24, 2024

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?

from browserify-transform-tools.

bodokaiser avatar bodokaiser commented on May 24, 2024

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).

from browserify-transform-tools.

jwalton avatar jwalton commented on May 24, 2024

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. :/

from browserify-transform-tools.

jwalton avatar jwalton commented on May 24, 2024

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?

from browserify-transform-tools.

bodokaiser avatar bodokaiser commented on May 24, 2024

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...

from browserify-transform-tools.

jwalton avatar jwalton commented on May 24, 2024

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" [email protected] 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//issues/2#issuecomment-31317964
.

from browserify-transform-tools.

bodokaiser avatar bodokaiser commented on May 24, 2024

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 [email protected]:

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" [email protected] 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//issues/2#issuecomment-31317964
.


Reply to this email directly or view it on GitHub.

from browserify-transform-tools.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.