Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
brandoncollins7 opened this issue Mar 7, 2018 · 2 comments
Assignees
Labels
non issue Issue is not a problem or requires changes

Comments

@brandoncollins7
Copy link

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 Marsup self-assigned this Mar 7, 2018
@Marsup Marsup added the non issue Issue is not a problem or requires changes label Mar 7, 2018
@Marsup
Copy link
Contributor

Marsup commented Mar 7, 2018

Duplicate of outmoded/discuss#642, closing.

@Marsup Marsup closed this as completed Mar 7, 2018
@lock
Copy link

lock bot commented Jan 9, 2020

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.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
non issue Issue is not a problem or requires changes
Projects
None yet
Development

No branches or pull requests

2 participants