These are chat archives for rosshinkley/nightmare

17th
Sep 2016
Drew Wallace
@drew-wallace
Sep 17 2016 17:51
Can anyone recreate this: segmentio/nightmare#791
Drew Wallace
@drew-wallace
Sep 17 2016 20:42
Nevermind. I figured it out.
Updated the issue ^
Nick Zhang
@AmINick
Sep 17 2016 22:53
This message was deleted
Hi Im very new to this, just wondering why it gives me this error
this.queue((done) => {
This message was deleted
 this.queue((done) => {
                  ^

SyntaxError: missing ) after argument list
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:413:25)
    at Object.Module._extensions..js (module.js:448:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/nickz/Desktop/UW Robot/sample.js:1:79)
    at Module._compile (module.js:430:26)
    at Object.Module._extensions..js (module.js:448:10)
:worried:
Nick Zhang
@AmINick
Sep 17 2016 23:16
oh ok, node want link to the latest version
Rob Brackett
@Mr0grog
Sep 17 2016 23:53
Yeah, I think you need to be on 4.x or later for arrow functions to work.
Nick Zhang
@AmINick
Sep 17 2016 23:53
yeah thanks for confirming that
also I couldnt find it any where in the api doc, but do I have to have .catch in my code?
apparently the window never shows or the code never runs when I dont have .catch included in my code
Ross Hinkley
@rosshinkley
Sep 17 2016 23:57
no, you should not have to have a .catch()
Rob Brackett
@Mr0grog
Sep 17 2016 23:57
no, you don't have to have .catch(), but you need to do something that actually triggers your queued actions to run, which can be any of:
  • .then()
  • .catch()
  • .run(function() { /* callback required here */ })
  • .end(function() { /* if no callback, end() does not start executing actions */ })
Ross Hinkley
@rosshinkley
Sep 17 2016 23:57
:point_up:
beat me to it :)
Rob Brackett
@Mr0grog
Sep 17 2016 23:57
heh
Nick Zhang
@AmINick
Sep 17 2016 23:57
:clap: you guys are awesome, thanks
Rob Brackett
@Mr0grog
Sep 17 2016 23:58
.end() without a callback is just a marker to “close the browser” when all your actions are finished
but with a callback it also starts execution
Nick Zhang
@AmINick
Sep 17 2016 23:58
I see
Rob Brackett
@Mr0grog
Sep 17 2016 23:59

And finally, if you use generator functions,

yield nightmareInstance

will implicitly call .then(), so that will also trigger actions to execute

Nick Zhang
@AmINick
Sep 17 2016 23:59
:ok_hand: