Differential / meteor-workers

Spawn headless worker meteor processes to work on async jobs.
80 stars 9 forks source link

_.endsWith exception when initializing #8

Open slowdownitsfine opened 9 years ago

slowdownitsfine commented 9 years ago

Hi,

I'm loving the Meteor Workers and the simplicity behind them!

However during the startup of Meteor (1.0.4.2), after adding differential:workers to packages I was getting the following exception trace (edited):

...
Object function (obj) {
W20150326-19:53:41.929(1)? (STDERR)     if (obj instanceof _) return obj;
W20150326-19:53:41.929(1)? (STDERR)     if (!(this instanceof _)) return new _(obj);
W20150326-19:53:41.929(1)? (STDERR)     this._wrapped = obj;
W20150326-19:53:41.929(1)? (STDERR)   } has no method 'endsWith' date=Thu Mar 26 2015 19:53:41 GMT+0100 (CET), pid=65654, uid=501, gid=20, 
...
trace=[column=23, file=packages/differential:workers/lib/init.coffee, function=null, line=5, method=null, native=false, column=22
...

I didn't know _.endsWith() and didn't know that Underscore.string wasn't part of the standard Underscore distribution.

I found a workaround for this problem which consisted in adding underscorestring:underscore.string to packages and mapping the function under the globally exported s by the package to underscore like so:

_.endsWith = s.endsWith

Maybe this could be fixed by adding underscorestring:underscore.string to the dependencies of the package and changing the call to _.endsWith ... but that's just a suggestion :)

schnie commented 9 years ago

Yep, sounds like a good idea! Missed that!

On Thu, Mar 26, 2015 at 3:09 PM, Daniel Cusan notifications@github.com wrote:

Hi,

I'm loving the Meteor Workers and the simplicity behind them!

However during the startup of Meteor (1.0.4.2), after adding differential:workers to packages I was getting the following exception trace (edited):

... Object function (obj) { W20150326-19:53:41.929(1)? (STDERR) if (obj instanceof ) return obj; W20150326-19:53:41.929(1)? (STDERR) if (!(this instanceof )) return new _(obj); W20150326-19:53:41.929(1)? (STDERR) this._wrapped = obj; W20150326-19:53:41.929(1)? (STDERR) } has no method 'endsWith' date=Thu Mar 26 2015 19:53:41 GMT+0100 (CET), pid=65654, uid=501, gid=20, ... trace=[column=23, file=packages/differential:workers/lib/init.coffee, function=null, line=5, method=null, native=false, column=22 ...

I didn't know _.endsWith() and didn't know that Underscore.string wasn't part of the standard Underscore distribution.

I found a workaround for this problem which consisted in adding underscorestring:underscore.string to packages and mapping the function under the globally exported s by the package to underscore like so:

_.endsWith = s.endsWith

Maybe this could be fixed by adding underscorestring:underscore.string to the dependencies of the package and changing the call to _.endsWith ... but that's just a suggestion :)

— Reply to this email directly or view it on GitHub https://github.com/Differential/meteor-workers/issues/8.

slowdownitsfine commented 9 years ago

Sorry just saw #2 ...