rauchg / slackin

Public Slack organizations made easy
http://rauchg.com/slackin/
MIT License
6.51k stars 1.35k forks source link

Error: Cannot find module './../dist' #229

Open piercelamb opened 8 years ago

piercelamb commented 8 years ago

I clicked the "deploy to heroku" button and went through the required steps on the linked page to deploy. In the heroku logs after trying to load the site, i get:

2016-08-17T16:34:39.801215+00:00 heroku[web.1]: Starting process with command `bin/slackin --coc "$SLACK_COC" --channels "$SLACK_CHANNELS" --port 50877 [redacted, but here is where the API token is] 2016-08-17T16:34:41.649337+00:00 heroku[web.1]: Process exited with status 1 2016-08-17T16:34:41.582281+00:00 app[web.1]: Error: Cannot find module './../dist' 2016-08-17T16:34:41.582278+00:00 app[web.1]: throw err; 2016-08-17T16:34:41.582282+00:00 app[web.1]: at Function.Module._load (module.js:290:25) 2016-08-17T16:34:41.582280+00:00 app[web.1]: 2016-08-17T16:34:41.582279+00:00 app[web.1]: ^ 2016-08-17T16:34:41.582261+00:00 app[web.1]: module.js:341 2016-08-17T16:34:41.582283+00:00 app[web.1]: at Module.require (module.js:367:17) 2016-08-17T16:34:41.582286+00:00 app[web.1]: at Function.Module.runMain (module.js:447:10) 2016-08-17T16:34:41.582285+00:00 app[web.1]: at Function.Module._load (module.js:314:12) 2016-08-17T16:34:41.582283+00:00 app[web.1]: at require (internal/module.js:20:19) 2016-08-17T16:34:41.582284+00:00 app[web.1]: at Object. (/app/bin/slackin:5:15) 2016-08-17T16:34:41.582284+00:00 app[web.1]: at Module._compile (module.js:413:34) 2016-08-17T16:34:41.582285+00:00 app[web.1]: at Object.Module._extensions..js (module.js:422:10) 2016-08-17T16:34:41.582285+00:00 app[web.1]: at Module.load (module.js:357:32) 2016-08-17T16:34:41.582282+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:339:15) 2016-08-17T16:34:41.663243+00:00 heroku[web.1]: State changed from starting to crashed

gtyler commented 8 years ago

Did the same here and it fails. You need to use the other fork:

https://github.com/Wiredcraft/slackin

piercelamb commented 8 years ago

Perfect, worked. Thank you.

gtyler commented 8 years ago

Turns out that doesn't work. The other fork has the following issue:

7T22:13:45.431322+00:00 app[web.1]: Wed Aug 17 2016 22:13:45 GMT+0000 (UTC) – fetching 2016-08-17T22:13:45.473226+00:00 app[web.1]: Wed Aug 17 2016 22:13:45 GMT+0000 (UTC) – Error: Invalid Slack response: 429 2016-08-17T22:13:45.473229+00:00 app[web.1]: at SlackData.onres (/app/lib/slack.js:56:17) 2016-08-17T22:13:45.473230+00:00 app[web.1]: at /app/lib/slack.js:23:12 2016-08-17T22:13:45.473231+00:00 app[web.1]: at Request.callback (/app/node_modules/superagent/lib/node/index.js:746:30) 2016-08-17T22:13:45.473231+00:00 app[web.1]: at Request. (/app/node_modules/superagent/lib/node/index.js:135:10) 2016-08-17T22:13:45.473232+00:00 app[web.1]: at emitOne (events.js:90:13) 2016-08-17T22:13:45.473233+00:00 app[web.1]: at Request.emit (events.js:182:7) 2016-08-17T22:13:45.473233+00:00 app[web.1]: at IncomingMessage. (/app/node_modules/superagent/lib/node/index.js:938:12) 2016-08-17T22:13:45.473234+00:00 app[web.1]: at emitNone (events.js:85:20) 2016-08-17T22:13:45.473235+00:00 app[web.1]: at IncomingMessage.emit (events.js:179:7) 2016-08-17T22:13:45.473235+00:00 app[web.1]: at endReadableNT (_stream_readable.js:913:12) 2016-08-17T22:13:45.473312+00:00 app[web.1]: Wed Aug 17 2016 22:13:45 GMT+0000 (UTC) – retrying

BUT this version is working:

https://heroku.com/deploy?template=https://github.com/niftylettuce/slackin/tree/master

OKNoah commented 8 years ago

@gtyler Also broken.

2016-08-20T02:29:02.801959+00:00 heroku[web.1]: Starting process with command `bin/slackin --coc "$SLACK_COC" --channels "$SLACK_CHANNELS" --port 3475 my-slack.slack.com slack-key`
2016-08-20T02:29:05.730489+00:00 heroku[web.1]: Process exited with status 1
2016-08-20T02:29:05.497794+00:00 app[web.1]: Sat Aug 20 2016 02:29:05 GMT+0000 (UTC) – fetching
2016-08-20T02:29:05.567878+00:00 app[web.1]: Sat Aug 20 2016 02:29:05 GMT+0000 (UTC) – listening on 0.0.0.0:3475
2016-08-20T02:29:05.625911+00:00 app[web.1]: /app/dist/slack.js:53
2016-08-20T02:29:05.625913+00:00 app[web.1]:         (res.body.channels || []).forEach(function (channel) {
2016-08-20T02:29:05.625931+00:00 app[web.1]:             ^
2016-08-20T02:29:05.625932+00:00 app[web.1]: 
2016-08-20T02:29:05.625932+00:00 app[web.1]: TypeError: Cannot read property 'body' of undefined
2016-08-20T02:29:05.625933+00:00 app[web.1]:     at /app/dist/slack.js:53:13
2016-08-20T02:29:05.625933+00:00 app[web.1]:     at Request.callback (/app/node_modules/superagent/lib/node/index.js:746:30)
2016-08-20T02:29:05.625941+00:00 app[web.1]:     at ClientRequest.<anonymous> (/app/node_modules/superagent/lib/node/index.js:711:10)
2016-08-20T02:29:05.625951+00:00 app[web.1]:     at ClientRequest.emit (events.js:182:7)
2016-08-20T02:29:05.625950+00:00 app[web.1]:     at emitOne (events.js:90:13)
2016-08-20T02:29:05.625951+00:00 app[web.1]:     at TLSSocket.socketErrorListener (_http_client.js:306:9)
2016-08-20T02:29:05.625952+00:00 app[web.1]:     at emitOne (events.js:90:13)
2016-08-20T02:29:05.625953+00:00 app[web.1]:     at TLSSocket.emit (events.js:182:7)
2016-08-20T02:29:05.625953+00:00 app[web.1]:     at emitErrorNT (net.js:1265:8)
2016-08-20T02:29:05.625958+00:00 app[web.1]:     at _combinedTickCallback (internal/process/next_tick.js:74:11)
2016-08-20T02:29:05.743427+00:00 heroku[web.1]: State changed from starting to crashed
2016-08-20T02:29:05.744399+00:00 heroku[web.1]: State changed from crashed to starting
2016-08-20T02:29:07.043719+00:00 heroku[web.1]: Starting process with command `bin/slackin --coc "$SLACK_COC" --channels "$SLACK_CHANNELS" --port 56933 my-slack.slack.com slack-key`
2016-08-20T02:29:09.374471+00:00 heroku[web.1]: Process exited with status 1
2016-08-20T02:29:09.239040+00:00 app[web.1]: Sat Aug 20 2016 02:29:09 GMT+0000 (UTC) – fetching
2016-08-20T02:29:09.261001+00:00 app[web.1]: Sat Aug 20 2016 02:29:09 GMT+0000 (UTC) – listening on 0.0.0.0:56933
2016-08-20T02:29:09.291589+00:00 app[web.1]: /app/dist/slack.js:59
2016-08-20T02:29:09.291592+00:00 app[web.1]:                       ^
2016-08-20T02:29:09.291591+00:00 app[web.1]:         var team = res.body.team;
2016-08-20T02:29:09.291596+00:00 app[web.1]: TypeError: Cannot read property 'body' of undefined
2016-08-20T02:29:09.291592+00:00 app[web.1]: 
2016-08-20T02:29:09.291596+00:00 app[web.1]:     at /app/dist/slack.js:59:23
2016-08-20T02:29:09.291597+00:00 app[web.1]:     at Request.callback (/app/node_modules/superagent/lib/node/index.js:746:30)
2016-08-20T02:29:09.291598+00:00 app[web.1]:     at emitOne (events.js:90:13)
2016-08-20T02:29:09.291598+00:00 app[web.1]:     at ClientRequest.<anonymous> (/app/node_modules/superagent/lib/node/index.js:711:10)
2016-08-20T02:29:09.291598+00:00 app[web.1]:     at ClientRequest.emit (events.js:182:7)
2016-08-20T02:29:09.291599+00:00 app[web.1]:     at TLSSocket.socketErrorListener (_http_client.js:306:9)
2016-08-20T02:29:09.291599+00:00 app[web.1]:     at emitOne (events.js:90:13)
2016-08-20T02:29:09.291600+00:00 app[web.1]:     at TLSSocket.emit (events.js:182:7)
2016-08-20T02:29:09.291600+00:00 app[web.1]:     at emitErrorNT (net.js:1265:8)
2016-08-20T02:29:09.291600+00:00 app[web.1]:     at _combinedTickCallback (internal/process/next_tick.js:74:11)
2016-08-20T02:29:09.369079+00:00 heroku[web.1]: State changed from starting to crashed
itechdom commented 8 years ago

It seems that the issue is resolved by pushing the dist folder generated by the build (gulp in this case). I used heroku-cli to clone the app, then I just ran npm install, which in turn generated the dist folder. I pushed it to master afterwards and it worked.

Also, take a look at https://github.com/rauchg/slackin/issues/221

rootical commented 8 years ago

Any better solution then @itechdom offers? It shouldn't be like this.

236 doesn't seem to help.