cujojs / cram

Simple, yet powerful, AMD and CommonJS module bundler.
http://cujojs.com
58 stars 9 forks source link

Error in compiled javascript #7

Closed joefiorini closed 11 years ago

joefiorini commented 11 years ago

I'm getting a browser error in Cram's compiled javascript.

TypeError: 'undefined' is not a function (near '...})...')

I cannot get a stack trace for this (everything is compiled anyway), but the error is around L764 of my compile js file:


    function identity(x) {
        return x;
    }

    return when;
});
})(typeof define == 'function' && define.amd
    ? define
    : function (factory) { typeof exports === 'object'
        ? (module.exports = factory())
        : (this.when      = factory());
    }
    // Boilerplate for AMD, Node, and browser global
);
/** @license MIT License (c) copyright B Cavalier & J Hann */

Any thoughts?

unscriptable commented 11 years ago

Hey Joe,

I think I know what's causing this and have a solution in my local repo. However, I was not able to push anything stable this evening since I ran out of time. I'll be on a plane all day tomorrow (Tuesday), so I won't be able to push anything until evening.

I also figured out the problem with overriding packages. It looks like I'll be able to push a fix for that tomorrow evening, as well.

-- John

unscriptable commented 11 years ago

If you want to temporarily "fix" the overriding packages problem, try replacing the following line in cram/lib/config/merge.js's mergeArrays function. Change this:

combined = (base || []).concat(ext || []).sort(sort);

to this:

combined = (ext || []).concat(base || []).sort(sort);

This is not even close to a final solution, but will hopefully fix your immediate roadblock.

joefiorini commented 11 years ago

Thanks! I'm at a conference this week, so I probably won't be getting back to it until Monday. I'll try to implement that fix when I have a chance.

TimNZ commented 11 years ago

John, can you please commit your updates.

unscriptable commented 11 years ago

fixed by recent commits