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.

x promise then method not working

See original GitHub issue

Subject of the issue

Promise support not working ?

Your environment

  • version of node: 8.9.1
  • version of npm: 5.5.1

Steps to reproduce

const Xray = require('x-ray');                                                                                  
                                                                                                                
const x = Xray();                                                                                               
                                                                                                                
x('https://blog.ycombinator.com', '.post', [{                                                                   
  title: 'h1 a',                                                                                                
  link: '.article-title@href'                                                                                   
}]).then(res => console.log(res));                                                                              

Expected behaviour

Should console log the array of news

Actual behaviour

TypeError: x(...).then is not a function

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:9
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dfcowellcommented, Dec 1, 2017

Looks like this might be related to #277.

Can you try installing with the repo clone URI? That might be a workaround.

1reaction
willisplummercommented, Nov 15, 2017

I’m getting the same result

Read more comments on GitHub >

github_iconTop Results From Across the Web

Promise.prototype.then() - JavaScript - MDN Web Docs
The then() method of a Promise object takes up to two arguments: callback functions for the fulfilled and rejected cases of the Promise....
Read more >
Promise then function not executed - javascript - Stack Overflow
I never get to see the log- "READ FROM DATABASE". However the function indexMovie executes perfectly. What am I doing wrong. I am...
Read more >
Resolving the JavaScript Promise Error "TypeError: Cannot ...
After all, you get this error when calling the then() method on a Promise . And the TypeError indicates you are calling then()...
Read more >
JavaScript Promises – The promise.then, promise.catch and ...
A promise is an object in JavaScript that will produce a value sometime in the future. This usually applies to asynchronous operations.
Read more >
Wait for Promise to finish executing in Javascript Function
How can I get the function to wait for the APEX method to complete, so that it can assign the result to the...
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