Can someone help me deploy my discord bot from Railway?

I have a simple bot I wrote in js that im having trouble deploying via railway. any help would be appreciated mildpanic i am aware that im a newb and this is probably a rather uncomplicated issue Project ID: ||a5ab474b-986a-421e-8057-a321ca3f38cb||
30 Replies
Percy
Percyβ€’2y ago
Project ID: a5ab474b-986a-421e-8057-a321ca3f38cb
*π”°π”²π” π” π”²π”Ÿπ”²π”°
Error I got: ============== ο»ΏUsing Nixpacks ο»Ώ============== ο»Ώ ο»Ώcontext: 3acce8e35f744a1625653fb4066072a8 ο»ΏNixpacks build failed ο»Ώ ο»Ώ ο»ΏNixpacks was unable to generate a build plan for this app. ο»ΏPlease check the documentation for supported languages: https://nixpacks.com ο»Ώ ο»ΏThe contents of the app directory are: ο»Ώ ο»Ώ.env ο»Ώindex.js ο»Ώpackage-lock.json
Getting Started | Nixpacks
App source + Nix packages + Docker = Image
Brody
Brodyβ€’2y ago
i see a few things wrong, lets start with the most important one: you are using a .env file in a github repo, this is a huge security concern, you should not be hardcoding any credentials, please use service variables in railway.
*π”°π”²π” π” π”²π”Ÿπ”²π”°
i regened the token but left it there for viewing purposes so, remove .env and leave it as a variable?
Brody
Brodyβ€’2y ago
thats good, but please still use service variables https://docs.railway.app/develop/variables#defining-variables
*π”°π”²π” π” π”²π”Ÿπ”²π”°
done, so what now? after removing the file and fixing the variable i still get that same error
Brody
Brodyβ€’2y ago
show me your railway service variables please (keep the values hidden)
Brody
Brodyβ€’2y ago
is your .env file in your .gitignore file?
*π”°π”²π” π” π”²π”Ÿπ”²π”°
no, guessing i should do that
Brody
Brodyβ€’2y ago
yes please
Brody
Brodyβ€’2y ago
let me know when done, so we can move onto the next issue
*π”°π”²π” π” π”²π”Ÿπ”²π”°
sorry, was messing around a bit. ive done that, what next
Brody
Brodyβ€’2y ago
send me your package.json please
Brody
Brodyβ€’2y ago
send me your package.json please
Brody
Brodyβ€’2y ago
you are missing a start script, add one and then resend the file also you can just send the file through discord, no need to use that share thing in the mean time, send me your .gitignore file
Brody
Brodyβ€’2y ago
open package.json with a text editor and add one
Brody
Brodyβ€’2y ago
looks about right does your project now include a package-lock.json file?
*π”°π”²π” π” π”²π”Ÿπ”²π”°
yeah that was the first one i sent
Brody
Brodyβ€’2y ago
good, push your changes to your repo
*π”°π”²π” π” π”²π”Ÿπ”²π”°
took a while because my repo... broke but its done, it says success. im going to verify if the bot stays online
Brody
Brodyβ€’2y ago
no problem!
Want results from more Discord servers?
Add your server