Closed fredngo closed 8 years ago
@fredngo Thanks for the detailed report! We'll look into it.
Any ideas about this? We are essentially locked to the increasingly outdated version 1.1.0 of the cloudinary gem due to this...
Confirmed. The issue is with the name of the Param() argument short
. We'll fix it.
If in a rush, issue the following command:
sed -i 's/\bshort\b/shortName/g' jquery.cloudinary.js
and then run yui-compressor again.
@fredngo Please update your cloudinary gem to version 1.2.1:
gem 'cloudinary', '~> 1.2', '>= 1.2.1'
It should solve the issue.
@tocker Thank you so much for the followup!
@tocker Unfortunately it's too huge of a jump to go from 1.1.0 to 1.2.1/2... Nothing works anymore. :) The underlying JS probably changed a lot from 1.1.0 to 1.2.2. Thanks for the fix though, I'll slowly debug to see where the problem might be.
@fredngo if your error is on the UI, it may be due to the initialization of the JavaScript upload plugin. Simply call $.cloudinary_file_upload()
after the page loads. Otherwise 1.2.1 should be backward compatible with 1.1.0.
@tocker Appreciate the pointer, I'll definitely check that out!
Steps to Reproduce
jquery.cloudinary.js
, and you should be able to reproduce the error. (Adjust the path toyuicompressor-2.4.8.jar
file if you are not usingrbenv
)More Details
I am using Cloudinary in a Rails application.
Recently I upgraded the cloudinary gem from 1.1.0 to 1.1.2, and the application javascripts were no longer compiling when doing
rake assets:precompile
. Version 1.1.1 of the gem exhibited the same problem. Version 1.1.0 continue to work as expected.As part of the asset pipeline compilation process, I am using the YUI-compressor gem to minify the application Javascript.
I am reporting the issue in this repository and not in the cloudinary_gem repo, because I eventually tracked the issue down to the
jquery.cloudinary.js
file in this repository, which throws errors when being minified.The last version of
jquery.cloudinary.js
that is minifiable appears to be in the1.0.25
release ofcloudinary_js
, with the SHA of109ff78056b161e8260b52b779554750f533e3d1
, which appears to be the version present in version 1.1.0 ofcloudinary_gem
.Below are the error messages that appear when trying to minify
jquery.cloudinary.js
:However, it worked on version
109ff78056b161e8260b52b779554750f533e3d1
:So, something happened after the
109ff78056b161e8260b52b779554750f533e3d1
version of the file after September 1 that brokejquery.cloudinary.js
, as far as its ability to be minimized goes.This probably breaks a lot of Rails applications as minimization is routinely done as part of asset compilation!