unscriptable/curl — Issue #27: Can't load named modules asynchronously
Author: rpflorence
Created: 2011-10-13 21:35:41+00:00
State: open

### The error

The module at `util/foo`.

```javascript
define('foo', { foo: 'bar' })
```

The loading:

```javascript
require(['util/foo'], function (f) { console.log(f) });
```

Gives this error: `Error: define() not found or duplicates found: /public/javascripts/compiled/util/invoker.js`

RequireJS loads it just fine.

### Why?!

We're migrating our codebase to AMD, but its far too large to do all at once, so we're dropping in curl.js or require.js and using it for new development, and will go back and convert old code over time.

The end goal is to use the require.js optimizer and then curl.js in the browser, but not until everything is converted to AMD. So, for the time being, we are still using our old build process to concat all our JS together with Jammit and are naming our modules by hand.

However, for our specs / development of new stuff we'll be loading things asynchronously so we need it to be able to load named modules as if they were unnamed.

tl;dr