hapijs / glue

Server composer for hapi.js
Other
245 stars 62 forks source link

server.events is undefined after glue compose #119

Closed liiijz closed 5 years ago

liiijz commented 5 years ago

Context

What are you trying to achieve or the steps to reproduce ?

below codes Why is server.events undefined? I want to use server.events.on... as doc mentioned

const composer = async () => {
  const server = await Glue.compose(Manifest, composeOptions);
  await server.start();
  console.log(server.events);
  server.log('error', `Server started @ ${server.info.uri}`);
  return server;
}
WesTyler commented 5 years ago

I haven't taken a look at this specifically, but try using Glue version 5. There was a fairly significant refactor of the internals to support hapi 17. I would expect lots of weird behavior and breakages using Glue@4 with hapi@17

WesTyler commented 5 years ago

If you do want to update to Glue 5 from Glue 4, I wrote a short post on the differences here

liiijz commented 5 years ago

thanks! after update to glue 5, it's OK!

WesTyler commented 5 years ago

Excellent! Glad to hear it!

lock[bot] commented 4 years ago

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.