unscriptable/curl — Issue #36: "Promise Already Completed" when trying to use underscore as a module
Author: manast
Created: 2011-12-07 21:22:40+00:00
State: open

Underscore.js is, according to the documentation, supposed to work in requirejs. When I try to use it together with curl, I get the following error and callstack:

Uncaught Error: Promise already completed.
bcurl.js:4
bcurl.js:4
bcurl.js:7
Kcurl.js:9
Rcurl.js:7
bcurl.js:11
(anonymous function)underscore.js:11
(anonymous function)

But the strange thing is that despite the error, underscore is available. I used the same approach as for loading jquery, i.e. added underscore to the paths option:
```javascript
curl = {
baseUrl:'/js',
paths:{
shaders:'../shaders',
underscore:'lib/underscore'
},
apiName:'require'
};
```
Then in the modules that depend on underscore:

```javascript
define(['underscore'], function(_){ ... });

```

Any ideas why this error is happening?