2

Could someone help me with this, I'm running an AWS Lambda using Chromeless and Serverless, I keep getting the same error.

My code:

import Chromeless from 'chromeless'

export default async () => {
  const chromeless = new Chromeless({
    remote: {
      endpointUrl: 'https://xxx.execute-api.eu-west-2.amazonaws.com/staging',
      apiKey: 'xxx'
    },
  })

  const screenshot = await chromeless
    .goto('https://www.google.com')
    .type('chromeless', 'input[name="q"]')
    .screenshot()

  console.log(screenshot)

  await chromeless.end()
}

The error:

(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Unknown command: protocol

I cant find anything online that could help, so I ran this code as a test and it still fails, it seems to fail as soon as I try and pass anything into screenshot, it doesn't work with .evaluate() or .html() either. If anyone could help that would be greatly appreciated I can provide any other files needed!

Zed BF
  • 31
  • 4
  • Always wrap your `await`-ed calls with a `try...catch`. While this alone will not fix your problem, looking at the error inside the `catch` statement will give you a better idea where it went wrong. – Noel Llevares Jan 07 '18 at 12:25

0 Answers0