RaveJS / rave

Zero-configuration application bootstrap and development
278 stars 8 forks source link

Error: AMD define not called #76

Open CNSKnight opened 9 years ago

CNSKnight commented 9 years ago

The following pattern results in the titled thrown error:

example.js:

(function (root, factory) {
        if (typeof define === 'function' && define.amd) {
            // AMD. Register as an anonymous module.
            define(factory);
        } else {
            // Browser globals
            root.form2js = factory();
        }
}(this, (function(namespace) {
        return function () {
            ...
            return something;
        };
})(myNamespace)));
unscriptable commented 9 years ago

That looks like it should be correctly sniffed by rave's autodetect mechanism. Is there a module: [] property in the bower.json or package.json for the package where that module resides? If so, what is it?

You can override the bower.json or package.json setting.

CNSKnight commented 9 years ago

example.js above is not a package and has not (in this case) a bower.json

unscriptable commented 9 years ago

Hey @CNSKnight, rave requires a top-level bower.json and/or package.json and requires that you use bower or npm to install all third-party packages. Have you looked at Developing apps with rave?