Open mariussoutier opened 11 years ago
Ok, there seems to be an implicit requirement, I have to define jquery.ui.widget
as a module with the same name:
define("jquery.ui.widget", ["webjars!ui/jquery.ui.widget.js", "jQuery"], function(w, jQuery) {});
This basically works, however sometimes it's not loaded in the correct order (jquery.ui.widget loads before jQuery), and everything blows up...
Looks like I need to add the jquery.ui.widget
definition to: https://github.com/webjars/jquery-ui/blob/master/src/main/resources/webjars-requirejs.js
I think it should be:
requirejs.config({
shim: {
'jquery-ui': [ 'webjars!jquery.js' ],
'jquery.ui.widget': [ 'webjars!jquery.js' ]
}
});
That seem right?
Yes, looking good. But there should be some way to also check the requirejs.config from the loaded JS file. Otherwise we will run into this issue again and again.
Do you have by chance a working example of WebJars + fileupload + RequireJS? As soon as I try to use fileupload's submodules (e.g. jquery.fileupload-angular.js
), I get stuck in dependency hell.
This error makes no sense to me, so I guess it's again some missing sub-dependency:
GET http://localhost:9000/webjars/jquery-file-upload/8.4.2/js/jquery.fileupload 404 (Not Found)
Maybe @huntc can help since he is the WebJars + RequireJS guru.
Hi,
I'm trying to use jQuery-File-Upload from WebJars & RequireJS. Problem is, no matter what I do, RequireJS tries to load an additional
jquery.ui.widget.js
(from the same folder where my main.js is), even though thefile-upload
WebJar already defines this as a dependency.I also tried to manage this dependency explicitly:
But the error doesn't go away, and
file-upload
fails to load. Do you have any clue how to solve this?Thanks