question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Promise was collected" error message: is this a kind of timeout ?

See original GitHub issue

Hi, I’m using node 7 + CRI 0.18.

I encounter this error while waiting a promise completion: “Promise was collected”.

I can reproduce this issue with that code:

Runtime.evaluate({ expression:generateExpression(insertJsScript), awaitPromise:true }).then(function (response) {
    console.log('response:', response);
});

/* Stringified and executed remotely in chrome headless. */
function insertJsScript() {
    return new Promise(function (resolve, reject) {
        setTimeout(resolve, 1000);
    });
}

/* Generate an IIEF string invoking `fn` */
function generateExpression(fn) {
    return '(' + fn.toString() + ')()';
}

It looks like a timeout error. When reducing timeout to 350ms, everything is fine.

So I’m wondering, is this a timeout ? And if so, how can I configure it ?

Thanks.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
cyrus-andcommented, Apr 5, 2017

@wi-ski the README and the wiki are good starting points, you may also want to check out the protocol documentation. 😃

0reactions
cyrus-andcommented, Apr 7, 2017

What is the difference between Console.messageAdded and Log.entryAdded ?

No idea, sorry. Try asking in the Google Group or file an issue to the official repo.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NodeJS Timeout a Promise if failed to complete in time
class MyPromise extends Promise { constructor(timeout, callback) { // We need to support being called with no milliseconds // value, because the various ......
Read more >
Timeout error that makes unfuctional the wweb app
I'm using Angular and the auth0-spa-js SDK to authenticate. In the web application the user doesn't watch any message or page about some...
Read more >
Apply Timeout to JavaScript Promises | by saransh kataria
JavaScript promises do not have any time associated with them. We can use a .then() function and wait until the promise is resolved...
Read more >
A Complete Guide to Timeouts in Node.js - Better Stack
Assigning timeout values prevents network operations in Node.js from blocking indefinitely. This article provides extensive instruction on ...
Read more >
How can I add a timeout to a promise in JavaScript?
There's nothing particularly complicated about this code sample, really. All it does is use the Promise constructor to wrap setTimeout() and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found