node.js cannot read property of "New"
<p>I'm trying to resolve an issue with my Alexa Skill right now. I watched and read a lot of tutorials and tried to search for it, but I always get a cryptic Error Message from Node.js...
I just try to send a http request, so nothing complicated.</p>

<p>My Code looks like this:</p>

<pre><code>var https = require('https')

exports.handler = (event, context) =&gt; {

  try {

    if (event.session.new) {
      console.log("NEW SESSION")
    }

    switch (event.request.type) {

      case "LaunchRequest":
        console.log(`LAUNCH REQUEST`)
        context.succeed(
          generateResponse(
            buildSpeechletResponse("Willkommen bei Taasker", true),
            {}
          )
        )
        break;

      case "IntentRequest":
        console.log(`INTENT REQUEST`)

        switch(event.request.intent.name) {
          case "taskernightlighton":
            var endpoint = "" 
            var body = ""
            http.request("https://autoremotejoaomgcd.appspot.com/sendmessage?key=xxxxxxxxxxxxx&amp;message=nightlighton")
            context.succeed(
                 generateResponse(
                    buildSpeechletResponse(`Licht wird von Taasker eingeschaltet`, true),
                    {}
                 )
            )
            break;

          case "taskernightlightoff":
            http.request("https://autoremotejoaomgcd.appspot.com/sendmessage?key=xxxxxxxxxx&amp;message=nightlightoff")
            context.succeed(
                 generateResponse(
                    buildSpeechletResponse(`Licht wird von Taasker ausgeschaltet`, true),
                    {}
                 )
            )
            break;

          default:
            throw "Invalid intent"
        }

        break;

      case "SessionEndedRequest":
        console.log(`SESSION ENDED REQUEST`)
        break;

      default:
        context.fail(`INVALID REQUEST TYPE: ${event.request.type}`)

    }

  } catch(error) { context.fail(`Exception: ${error}`) }

}

// Helpers
buildSpeechletResponse = (outputText, shouldEndSession) =&gt; {

  return {
    outputSpeech: {
      type: "PlainText",
      text: outputText
    },
    shouldEndSession: shouldEndSession
  }

}

generateResponse = (speechletResponse, sessionAttributes) =&gt; {

  return {
    version: "1.0",
    sessionAttributes: sessionAttributes,
    response: speechletResponse
  }

}
</code></pre>

<p>And I always receive the following error: </p>

<pre><code>{
  "errorMessage": "Exception: TypeError: Cannot read property 'new' of undefined"
}
</code></pre>

<p>Can someone give me a hint, what is wrong with my javascript syntax? I cannot find a source explaining this http request? Please help...</p>