Closed Cramertech closed 10 years ago
Could you factor your code out into plugins (examples on http://www.nightmarejs.org/) ?
I think the organization will help with debug, and you can think about smaller chunks of this logic at a time. Specifically, having a single plugin handle one card, and then building on that abstraction with a plugin that handles multiple cards (simply by attaching multiple uses of the first plugin, if preferable).
Also, to speak a little more to the actual problem -- could you reproduce the verbose log (just the part close to where it fails)?
Also, I would recommend using sync node functions, just to eliminate that as a point of complexity (I don't think there's anything wrong with the calls you have right now, but just in case...)
Actually when I went to refactor my code into plugins, I somehow magically solved the problem. I already had thought this could help before, but was being lazy. Good enough for me! Thank you.
Awesome, glad it was fixed! yeah the plugins are an awesome feature
This issue has to do with the previous one that I made last night, but this problem I'm having is different.
I'm really not sure if this is due to my not understanding loops or some other logic in node/javascript, or maybe from a possible bug.
What I'm trying to do is start a nightmare up, and immediately login. After the login I need it to iterate through the same code using different values, then finally at the end run the nightmare in that manner.
What happens is it works perfectly until about the 4th, 5th or 6th iteration and just quits unexpectedly with no error or feedback as to why.
Here's my code, which I think is fairly simple considering, but has a lot of lines to it already.