title: Hapi.js: "Class extends value undefined is not a constructor or null"
body: <p>I'd like to write an API in Typescript with Hapi.js and webpack transpiling and bundling the whole application.</p>
  
  <p>unfortunately when I create the simplest Hapi server (or even create a server instance) I get the following error:</p>
  
  <pre><code>exports = module.exports = internals.Response = class extends Http.ServerResponse {
                                                                     ^
  
  TypeError: Class extends value undefined is not a constructor or null
  </code></pre>
  
  <p>```</p>
  
  <p>my Hapi version is ^17.5.4 and the typings ^17.0.19, both should be the most recent versions.</p>
  
  <p><strong>index.ts</strong></p>
  
  <pre><code>import {Server, ServerOptions} from 'hapi';
  
  const options: ServerOptions = {
      host: 'localhost',
      port: '9000'
  }
  
  const server = new Server(options); // instsantiating the server causes the error
  </code></pre>
  
  <p><strong>webpack.config.ts</strong></p>
  
  <pre><code>const path = require('path');
  
  module.exports = {
      entry: './app/index.ts',
      mode: 'development',
      output: {
          path: path.resolve(__dirname, 'dist'),
          filename: 'app.bundle.js',
      },
      resolve: {
          extensions: ['.ts', '.js'],
          modules: [
               "node_modules",
               path.resolve(__dirname, "app")
          ],
      },
      module: {
           rules: [
              { test: /\.ts$/, loader: 'ts-loader' }
           ]
      },
      devtool: 'inline-source-map',
      node: {
          fs: 'empty',
          net: 'empty'
      }
  };
  </code></pre>
  
  <p><strong>tsconfig.json</strong></p>
  
  <pre><code>{
      "compilerOptions": {
          "module": "esnext",
          "target": "es5",
          "noImplicitAny": true,
          "removeComments": true,
          "sourceMap": true,
          "watch": true,
          "forceConsistentCasingInFileNames": true,
          "noImplicitThis": true,
          "lib": ["ES2015", "dom"],
          "moduleResolution": "node"
      },
      "compileOnSave": true,
      "include": [
          "*/src/**/*.ts",
          "*/src/**/*.tsx",
          "*/tests/**/*.ts",
          "*/index.ts",
          "tsd.d.ts"
        ]
  }
  </code></pre>
  
  <p>any help is appreciated!</p>