Question: I get this error: `Error: defineAlreadyDefined`, that only occurs with dojo.

**index.php**

```
<script data-main="app" src="require.js"></script>

```

---

**app.js**

```
require({
    paths : {
        dojo : 'http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojo/dojo'
    }
});

require([ 'dojo' ], function() {
   //something
});

```

I found a similar question, but didn't help me:

[When dojo.js loaded via ajax multiple times get Error: defineAlreadyDefined](https://stackoverflow.com/questions/9784314/when-dojo-js-loaded-via-ajax-multiple-times-get-error-definealreadydefined)

EDIT: I searched and I think the way that i am trying to use requiJS and Dojo is wrong.
<http://dojotoolkit.org/features/1.6/async-modules>

Any idea? thanks

Answer: 
In order to use a foreign loader w/ dojo you need to skip the dojo/dojo.js file, which defines the AMD loader. Your require config should have something like:

```
require({
    packages: [
        {
            name: 'dojo',
            location: 'dojo',
            main:'dojo/main' 
        }
    ]
});

```

However, the dojo loader is just as good at loading jQuery plugins as requireJS and it comes with a few additional plugins, like `dojo/has`. I'd give serious thought to just using it's loader.
Im not sure of what you want to accomplish here, but [Dojo implements requireJS](http://dojotoolkit.org/reference-guide/1.7/loader/amd.html). Therefore you don't need requireJS.

What you would do, for the normal use of Dojo library, is:

```
//call dojo script
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js"></script>
<script>
    var dojoConfig = (function(){
        return {
            async: true,
            //in case you wanted to use your own library
            paths: [{
                name: "location/library"//your library path
            }]
        };
    })();       

    require([
        "dojo/parser",
        "name/something",//calling 'somethong' from library
        "dojo/domReady!"
    ], function(parser, something /*your library obj*/){
        //your logic
        parser.parse();
        something.do();
    });
});
</script>

```