Chromeless: Error on end, Unhandled Promise

Created on 7 Aug 2017  路  15Comments  路  Source: prisma-archive/chromeless

I'm using v1.2.0 to have chromless log into spotify and get the user auth token to manage a playlist (they have to be associated to a user not an application).

After chromeless.end I get an unhandeled promise rejection. I do briefly see chrome asking to save the password? Maybe not related.

Error: No such target id: undefined
    at IncomingMessage.<anonymous> (/Users/scoope7/xm-playlist-backend/node_modules/chrome-remote-interface/lib/external-request.js:16:26)
    at emitNone (events.js:110:20)
    at IncomingMessage.emit (events.js:207:7)
    at endReadableNT (_stream_readable.js:1045:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)

the code requires working username and password

import { Chromeless } from 'chromeless';

async function run() {
      const chromeless = new Chromeless();
      const screenshot = await chromeless
        .goto('https://accounts.spotify.com/en/authorize?client_id=bcfe5f4d02244abfb7e38a3052f02a76&response_type=code&redirect_uri=http:%2F%2Flocalhost:5000%2FupdatePlaylist&scope=playlist-modify-public&state=xmplaylist')
        .click('.btn,.btn-sm')
        .wait('#login-username')
        .type(config.spotifyUsername, 'input#login-username')
        .type(config.spotifyPassword, 'input#login-password')
        .click('.btn-green');

      await chromeless.end();
}

Edit: To be clear. Even with a catch on both awaits the error is not caught and throws a UnhandledPromiseRejectionWarning.

API bug help wanted

Most helpful comment

A new version hasn't been cut yet with the fix.

All 15 comments

Same issue to me

I have same issue.
Node 6.2.2
Chrome 60
OSX 10.12.6

Same issue, but in my case I am playing one video asset on browser. It looks like node process is getting terminated but not chrome browser with end() call.

same issue with me.
Hopefully repaired ASAP.

Seeing it here too

Curious if any of the above cases trigger a pageload of some kind. Right now that's a feature we're missing in chromeless is multi-page interactions

Seems to occur even without doing anything for me:

const { Chromeless } = require('chromeless')

async function run() {
  const chromeless = new Chromeless()
  await chromeless.end()
}
run().catch(console.error.bind(console))

Node v8.1.3
Chrome 60.0.3112.90
Ubuntu 16.04

I'm still experiencing this issue in version 1.2 using the same codeblock that @mx781 had posted. Any updates?

A new version hasn't been cut yet with the fix.

Still having the problem, with the given example -

const { Chromeless } = require('chromeless')

async function run() {
  const chromeless = new Chromeless()

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

  console.log(screenshot) // prints local file path or S3 url

  await chromeless.end()
}

run().catch(console.error.bind(console))

The error -

(node:5437) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: No such target id: undefined
(node:5437) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Idem, same error with the given example.

Node v8.3.0
chromeless v1.2.0
Chrome 60.0.3112.113 (Build officiel) (64 bits)
Windows 10

@adieuadieu Why don't you just release new version?

I'm sorry for the delay. Just published v1.3.0 to NPM. Please do let us know if it resolves these issues!

It's working perfectly :+1:

Itou. Nickel 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bitflip2 picture bitflip2  路  6Comments

schickling picture schickling  路  5Comments

devfordays picture devfordays  路  3Comments

kellylawrence picture kellylawrence  路  4Comments

eitansela picture eitansela  路  4Comments