Skip to content
Advertisement

Hapijs server start error – Invalid server options

I am using this simple server program

JavaScript

which gave me the following error on server startup

JavaScript

and my package.json has dependencies set this way

JavaScript

I tried searching for this issue everywhere and found an exact one here but the versions are too old to be compared.

How do I resolve this problem?

Advertisement

Answer

The options you’re passing need to be passed to a call to server.connection() rather than into the Server constructor.

Snippet from hapi docs:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement