CharlieHess / slack-poker-bot

A bot that deals Texas Hold'em games in Slack
MIT License
1.66k stars 208 forks source link

Crashes trying to create DM channels for new game #67

Open jmhummel opened 8 years ago

jmhummel commented 8 years ago

Deployed to heroku. On first match (and every subsequent match), app crashed before game begun.

Getting DM channel for jeremy
Getting DM channel for eric
No open channel found, opening one using U0P8WHNMP
/app/node_modules/rx/dist/rx.js:579
    throw e;
          ^
TypeError: undefined is not a function
    at _loop (/app/src/texas-holdem.js:491:34)
    at TexasHoldem.dealPlayerCards (/app/src/texas-holdem.js:484:45)
    at TexasHoldem.playHand (/app/src/texas-holdem.js:103:10)
    at /app/src/texas-holdem.js:56:27
    at /app/node_modules/rx/dist/rx.js:4924:20
    at tryCatcher (/app/node_modules/rx/dist/rx.js:567:29)
    at InnerObserver.onNext (/app/node_modules/rx/dist/rx.js:4806:43)
    at InnerObserver.tryCatcher (/app/node_modules/rx/dist/rx.js:567:29)
    at AutoDetachObserverPrototype.next (/app/node_modules/rx/dist/rx.js:5274:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/app/node_modules/rx/dist/rx.js:1710:35)

npm ERR! Linux 3.13.0-85-generic
npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! slack-poker-bot@1.0.0 start: `node src/main.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the slack-poker-bot@1.0.0 start script 'node src/main.js'.
npm ERR! This is most likely a problem with the slack-poker-bot package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node src/main.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls slack-poker-bot
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /app/npm-debug.log
jmhummel commented 8 years ago

Ran locally, got this error on game start:

Getting DM channel for jeremy
/Users/jhummel/github/slack-poker-bot/node_modules/rx/dist/rx.js:579
    throw e;
    ^

TypeError: SlackApiRx.getOrOpenDm.subscribe is not a function
    at _loop (/Users/jhummel/github/slack-poker-bot/src/texas-holdem.js:491:34)
    at TexasHoldem.dealPlayerCards (/Users/jhummel/github/slack-poker-bot/src/texas-holdem.js:484:45)
    at TexasHoldem.playHand (/Users/jhummel/github/slack-poker-bot/src/texas-holdem.js:103:10)
    at /Users/jhummel/github/slack-poker-bot/src/texas-holdem.js:56:27
    at /Users/jhummel/github/slack-poker-bot/node_modules/rx/dist/rx.js:4924:20
    at tryCatcher (/Users/jhummel/github/slack-poker-bot/node_modules/rx/dist/rx.js:567:29)
    at InnerObserver.onNext (/Users/jhummel/github/slack-poker-bot/node_modules/rx/dist/rx.js:4806:43)
    at InnerObserver.tryCatcher (/Users/jhummel/github/slack-poker-bot/node_modules/rx/dist/rx.js:567:29)
    at AutoDetachObserverPrototype.next (/Users/jhummel/github/slack-poker-bot/node_modules/rx/dist/rx.js:5274:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/jhummel/github/slack-poker-bot/node_modules/rx/dist/rx.js:1710:35)
jmhummel commented 8 years ago

Issue seems to occur on the first game with a new player who hasn't had a DM with the bot before. Once the game crashes with the new player and is restarted, it works next time.

jdegger commented 7 years ago

confirmed i have the same