title: Heroku Help: Error waiting for process to terminate: No child processes
body: <p>First off my apologies as i am a complete noob.</p>
  
  <p>I created a JS bot for Discord that rolls dice for our TTRPG group playing Weave. </p>
  
  <p>The bot runs fine from my pc, and will run from GitHub on Heroku for a couple of minutes, and then throws an error: <code>Error waiting for process to terminate: No child processes</code>.</p>
  
  <p><strong>log:</strong></p>
  
  <pre><code>2020-05-14T06:08:44.097216+00:00 app[web.1]: &gt; node index.js
  2020-05-14T06:08:44.097217+00:00 app[web.1]: 
  2020-05-14T06:09:42.647001+00:00 heroku[web.1]: State changed from starting to crashed
  2020-05-14T06:09:42.651315+00:00 heroku[web.1]: State changed from crashed to starting
  2020-05-14T06:09:46.654014+00:00 app[web.1]: 
  2020-05-14T06:09:46.654028+00:00 app[web.1]: &gt; discordweavedicebot@1.0.0 start /app
  2020-05-14T06:09:46.654028+00:00 app[web.1]: &gt; node index.js
  2020-05-14T06:09:46.654029+00:00 app[web.1]: 
  2020-05-14T06:10:44.626907+00:00 app[web.1]: Error waiting for process to terminate: No child processes
  2020-05-14T06:10:44.707304+00:00 heroku[web.1]: State changed from starting to crashed
  </code></pre>
  
  <p>I've added a procfile making index.js a worker (per a suggestion on another thread)</p>
  
  <p><strong>procfile:</strong></p>
  
  <pre><code>worker node index.js
  </code></pre>
  
  <p><strong>package.json:</strong></p>
  
  <pre><code>{
    "name": "discordweavedicebot",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
      "start": "node index.js"
    },
    "author": "eddgue",
    "license": "ISC",
    "dependencies": {
      "discord.js": "^12.2.0"
    }
  }
  </code></pre>
  
  <p><strong>index.js:</strong></p>
  
  <pre><code>const Discord = require('discord.js');
  const bot = new Discord.Client();
  
  const dieFaces = ["Fail","Brook","Gale","Stone","Flame","Weave"];
  
  bot.on('message', (message) =&gt; {
      if(message.content == '!Roll 1' || message.content == '!roll 1' || message.content == '!Roll1' || message.content == '!roll1' || message.content == '!R1' || message.content == '!r1'){
          message.reply("You rolled: " + dieFaces[Math.floor(Math.random() * 6)]);
      }
  
      if(message.content == '!Roll 2' || message.content == '!roll 2' || message.content == '!Roll2' || message.content == '!roll2' || message.content == '!R2' || message.content == '!r2'){
          message.reply("You rolled: " + dieFaces[Math.floor(Math.random() * 6)] + ", " + dieFaces[Math.floor(Math.random() * 6)]);
      }
  
      if(message.content == '!Roll 3' || message.content == '!roll 3' || message.content == '!Roll3' || message.content == '!roll3' || message.content == '!R3' || message.content == '!r3'){
          message.reply("You rolled: " + dieFaces[Math.floor(Math.random() * 6)] + ", " + dieFaces[Math.floor(Math.random() * 6)] + ", " + dieFaces[Math.floor(Math.random() * 6)]);
      }
  
      if(message.content == '!Roll 4' || message.content == '!roll 4' || message.content == '!Roll4' || message.content == '!roll4' || message.content == '!R4' || message.content == '!r4'){
          message.reply("You rolled: " + dieFaces[Math.floor(Math.random() * 6)] + ", " + dieFaces[Math.floor(Math.random() * 6)] + ", " + dieFaces[Math.floor(Math.random() * 6)] + ", " + dieFaces[Math.floor(Math.random() * 6)]);
      }
  
      if(message.content == '!Roll 5' || message.content == '!roll 5' || message.content == '!Roll5' || message.content == '!roll5' || message.content == '!R5' || message.content == '!r5'){
          message.reply("You rolled: " + dieFaces[Math.floor(Math.random() * 6)] + ", " + dieFaces[Math.floor(Math.random() * 6)] + ", " + dieFaces[Math.floor(Math.random() * 6)] + ", " + dieFaces[Math.floor(Math.random() * 6)] + ", " + dieFaces[Math.floor(Math.random() * 6)]);
      }
  
      if(message.content == '!Roll 6' || message.content == '!roll 6' || message.content == '!Roll6' || message.content == '!roll6' || message.content == '!R6' || message.content == '!r6'){
          message.reply("You rolled: " + dieFaces[Math.floor(Math.random() * 6)] + ", " + dieFaces[Math.floor(Math.random() * 6)] + ", " + dieFaces[Math.floor(Math.random() * 6)] + ", " + dieFaces[Math.floor(Math.random() * 6)] + ", " + dieFaces[Math.floor(Math.random() * 6)] + ", " + dieFaces[Math.floor(Math.random() * 6)]);
      }
  })
  
  bot.login('XXXXXXXXXXXXX');
  </code></pre>
  
  <p>I think there are cleaner ways of achieving the same, but given my limited programming experience this was the best I could come up with.</p>
  
  <p>Any help would be greatly appreciated!! </p>