strongloop/loopback-context

Node 8 support

yellowred opened this issue · 7 comments

  • Bug
  • Feature request

Please provide Node 8 support for the loopback-context module.

Current state – crashing:

$ node --version
v8.2.1

$ node
> var exports = require('./node_modules/loopback-context')
/usr/local/opt/nvm/versions/node/v8.1.4/bin/node[51905]: ../src/async-wrap.cc:349:void node::SetupHooks(const FunctionCallbackInfo<v8::Value> &): Assertion `before_v->IsFunction()' failed.
 1: node::Abort() [/usr/local/opt/nvm/versions/node/v8.1.4/bin/node]
 2: node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, char const*, int, v8::Local<v8::Value>*, double, double) [/usr/local/opt/nvm/versions/node/v8.1.4/bin/node]
 3: node::SetupHooks(v8::FunctionCallbackInfo<v8::Value> const&) [/usr/local/opt/nvm/versions/node/v8.1.4/bin/node]
 4: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) [/usr/local/opt/nvm/versions/node/v8.1.4/bin/node]
 5: v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/usr/local/opt/nvm/versions/node/v8.1.4/bin/node]
 6: v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/usr/local/opt/nvm/versions/node/v8.1.4/bin/node]
 7: 0x1cb2368040bd
 8: 0x1cb2368e014b
[1]    51905 abort      node

$ node -e "console.log(require('./node_modules/loopback-context/package.json').version);"
3.2.0

NodeJS: 8.2.1
Loopback-Context: 3.2.0
System Version: macOS 10.12.5 (16F73)

@yellowred I'll see if I can get an update to the v4 branch of cls-hooked that at least doesn't make node barf when running v8. Btw, v5.alpha.1 of cls-hooked works with node 8.1.3. Problem is a semver ref in Loopback-Context.

I'm struggling with making a semver-major or minor of cls-hooked as the version that runs in node v8+ is using a completely different implementation (async-hooks) under the hood.

@Jeff-Lewis appreciate your efforts, just updated the feature request to node v8.2.1.

@yellowred Newly released v4.2.0 of cls-hooked now "works" with node ^4.7 || >=6.9 || >=7.3 || >=8.2.1

updating cls-hooked to v4.2.0 solved the issue, thanks a lot for the fast release

Newly released v4.2.0 of cls-hooked now "works" with node ^4.7 || >=6.9 || >=7.3 || >=8.2.1

Nice! It would be great to update our package.json to specify 4.2.0 as the minimal required version of cls-hooked, update "engines" field to include node versions ^8.2.1, add Node.js 8 to the list of platforms we are testing on Travis CI, and finally updating the list of supported Node.js versions in README - see #33. Any volunteers?

Done in loopback-context@3.3.0