underscore-cli icon indicating copy to clipboard operation
underscore-cli copied to clipboard

text output format not working

Open john-cosnowski opened this issue 9 years ago • 4 comments

--outfmt text appears to be broken because underscore.string version 3.2.3 added map function.

output is: Error formatting output data in mode 'text': undefined is not a function

john-cosnowski avatar Jan 18 '16 21:01 john-cosnowski

If somebody needs to hotfix, you can do it by simply removing a join here: https://github.com/makevoid/underscore-cli/commit/e0115038177fcb8d90a2713a38678fdc1c19eba5

I suppose the "base" error is in underscore.strings, from their docs they say the map function shouldn't be required when underscore.strings is mixed in underscore and the two function collide.

This code from u.strings ( https://github.com/epeli/underscore.string/blob/c1f7b1fa64bd6cecbe05689c05e66f7df68d8797/exports.js#L5 ) is checking for map and should not include it but it seems to get mixed in anyway for some reason.

makevoid avatar Feb 03 '16 13:02 makevoid

The package.json for underscore-cli is using "*" for underscore.string, which allows for broken compatibility (although in this case it probably would've broken anyway). We worked around this issue by adding a specific version of underscore.string to our package.json (not the underscore-cli package.json), which forces underscore-cli to use the working version.

Here is the version we are using: "underscore.string": "3.1.1"

kshamil76 avatar Feb 05 '16 17:02 kshamil76

Maybe it can be locked on master until the issue is fixed?

makevoid avatar Feb 05 '16 19:02 makevoid

+1. just ran into this

scien avatar Feb 10 '16 23:02 scien