strongloop / strong-globalize

strong-globalize is built on Unicode CLDR and jquery/globalize and implements automatic extraction of strings from JS source code and HTML templates, lint the string resource, machine-translate them in seconds. In runtime, it loads locale and string resource into memory and provides a hook to persistent logging.
Other
25 stars 16 forks source link

global.STRONGLOOP_GLB.getHash is not a function #85

Closed bbonneton closed 8 years ago

bbonneton commented 8 years ago

When I use "slc loopback:export-api-def", I get the following error :

events.js:141
      throw er; // Unhandled 'error' event
      ^

TypeError: global.STRONGLOOP_GLB.getHash is not a function
    at formatMessage (D:\Projects\loopback-api\node_modules\strong-globalize\lib\globalize.js:97:34)
    at Object.packMessage (D:\Projects\loopback-api\node_modules\strong-globalize\lib\globalize.js:194:17)
    at StrongGlobalize.f (D:\Projects\loopback-api\node_modules\strong-globalize\index.js:105:20)
    at Function.User.setup (D:\Projects\loopback-api\node_modules\loopback\common\models\user.js:673:15)
    at module.exports (D:\Projects\loopback-api\node_modules\loopback\common\models\user.js:761:8)
    at createModel (D:\Projects\loopback-api\node_modules\loopback\lib\builtin-models.js:74:5)
    at module.exports (D:\Projects\loopback-api\node_modules\loopback\lib\builtin-models.js:25:19)
    at Object.<anonymous> (D:\Projects\loopback-api\node_modules\loopback\lib\loopback.js:420:28)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

OS : Windows 10 Node : 4.5.0 NPM : 3.10.6 loopback@2.31.0

I used the following workaround : change strong-globalize\lib\globalize.js:97 from path = global.STRONGLOOP_GLB.getHash(path); to path = md5(path); which is a revert of one of your latest commits, so I guess that's not a real solution ;-)

I also had the same kind of error in strongloop arc while trying to test the db connection and it was solved with this workaround.

TimDuckworth commented 8 years ago

Similar issue found:

cloud/node_modules/loopback-connector-remote/node_modules/strong-remoting/node_modules/strong-globalize/lib/globalize.js:97 path = global.STRONGLOOP_GLB.getHash(path); ^

TypeError: global.STRONGLOOP_GLB.getHash is not a function

Setogit commented 8 years ago

@bbonneton @TimDuckworth : Will you try v2.6.10?

TimDuckworth commented 8 years ago

@Setogit confirmed that 2.6.10 does not have same issue I saw. Thank you.

bbonneton commented 8 years ago

@Setogit v2.6.10 solved the two issues I saw. Thanks a lot !