nodeca/js-yaml — Issue #38: RequireJS Working Example?
Author: plusjade
Created: 2012-02-09 21:28:00+00:00
State: open

I'm struggling to get this working with requireJS. I've tried the examples in the README with no luck.

Here is my control case:

```` javascript
define([
'require',
'jquery',
'mustache',
'js-yaml.min',
], function(require, $){

var JB = {
init : function(boot){
var doc = jsyaml.load('greeting: hello\nname: world');
console.log(doc); // this works fine.

//require('js-yaml.min'); // this works both uncommented and commented.

var singleDoc = require('http://127.0.0.1/~jade/javascripts/require-js/tags.yaml').shift();
console.log(singleDoc);
// This does not work
// Uncaught Error: Module name 'http://127.0.0.1/~jade/javascripts/require-js/tags.yaml' has not been loaded yet for context: _
// http://requirejs.org/docs/errors.html#notloaded

if(typeof boot === "function") boot();
}
};

return JB;
});
````

As per the error documentation () I have tried to load the tags.yaml first in the define statement. The tags.yaml loads fine but since its not javascript, It returns a syntax error.

Any help would be appreciated, thanks.