hapijs / yar

A hapi session manager
Other
133 stars 59 forks source link

Can't register plugin - UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'register' of undefined #118

Closed brandoncollins7 closed 6 years ago

brandoncollins7 commented 6 years ago

Simple code:

server = new Hapi.Server()

      await server.register({
        plugin: require('yar'),
        options: {
          storeBlank: false,
          cookieOptions: {
            password: 'the-password-must-be-at-least-32-characters-long',
            isSecure: true
          }
        }
      })

Hapi checks:

if (plugin.register.register) {                             // Required plugin
            plugin.register = plugin.register.register;
        }

yet plugin.register is undefined. Looks like it should be plugin.plugin.register

Marsup commented 6 years ago

Duplicate of https://github.com/hapijs/discuss/issues/642, closing.

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.