cujojs / curl

curl.js is small, fast, extensible module loader that handles AMD, CommonJS Modules/1.1, CSS, HTML/text, and legacy scripts.
https://github.com/cujojs/curl/wiki
Other
1.89k stars 216 forks source link

cjsm11 loader: checkToAddJsExt is not a function #252

Closed mk-pmb closed 10 years ago

mk-pmb commented 10 years ago

Hello curlers,

originally I got stuck on

TypeError: checkToAddJsExt is not a function @ ln 71, …/3rd-party/cujojs/loader/cjsm11.js

so I thought I put some wrong files and tried to use the pre-built kitchen-sink edition instead, but it yields:

TypeError: c.Ga is not a function @ ln 41, …/3rd-party/cujojs/curl-ks.min.js

so... what can I do to get the loader working?

Thanks in advance, MK

mk-pmb commented 10 years ago

If I guess correctly that

priv['core'].checkToAddJsExt

instead of

priv.core.checkToAddJsExt

is there to scare cram.js into not minifying core, maybe the function names should also be quoted where they were defined, src/curl.js:685 and src/curl.js:744?

Yours, MK

unscriptable commented 10 years ago

Ahhh, ok! I see. It's the versions in the dist/ folder! Got it. Thanks!

unscriptable commented 10 years ago

Wait. I see the problem. You have to minify curl and its loader, shims, and (in some cases) plugins at the same time. The minification-obfuscation tool will assign different obfuscated names if you attempt to minify them separately.

mk-pmb commented 10 years ago

Yes, that was one reason why I tried with the readnymade kitchen-sink edition dist/curl-kitchen-sink/curl.js. With that, I got the c.Ga is not a function error and had no idea where to put a work-around.

unscriptable commented 10 years ago

I found and fixed the c.Ga is not a function error in issue #253. Try using the make.sh utility to make your own custom curl.js. (You may have to run it from the bin/ folder. I always run it from there.) There are examples of how to use make.sh in the make-all.sh file.

Note: make.sh only works with curl's shims, loaders, and plugins.

unscriptable commented 10 years ago

Released in 0.8.9. :)