You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gives this error: Error: define() not found or duplicates found: /path/util/foo.js
RequireJS loads it just fine.
Why would we do this?!
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
The text was updated successfully, but these errors were encountered:
curl.js is strict about module ids. (It seems strange to me that RequireJS is not.) I can't think of a good use case for having them be different. Try this:
The module at util/foo.
// note the module id includes the package and/or folderdefine('util/foo',{foo: 'bar'})
Is there a reason to have the module name not include the package/folder name? If you need it to be different for some reason, you could use the paths: {} config to map it instead.
Also: the build-time mechanics of the AMD tools are not standardized, yet. What this means to you: require.js's optimizer could do things that curl.js's loader isn't expecting. We expect to have the details agreed upon soon, though. This shouldn't be an issue for you currently unless you are using plugins. That's where the AMD build tools differ the most right now. If there are other issues, they're likely minor and can be fixed easily, I suspect.
I haven't tried using curl.js with other optimizers in a while, so I would be very interested in your success. Your feedback is greatly appreciated!
Regards,
-- John
P.S. please close this issue if/when you're satisfied with my answer and/or solution. I hate when somebody closes my tickets before I think they're closed. :)
The error
The module at
util/foo
.The loading:
Gives this error:
Error: define() not found or duplicates found: /path/util/foo.js
RequireJS loads it just fine.
Why would we do this?!
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
The text was updated successfully, but these errors were encountered: