Deployment without a manually uploaded node module folder didn't work
As the title suggests, I had a really simple script that I needed to deploy and without my node modules folder manually uploaded (note, there was a package.json and all that), I couldn't properly deploy the script and was getting undefined errors from my dependancies.
54 Replies
Project ID:
N/A
Farazpatankar suggested that the start script might be the issue and to check the package.json file. Wyzlle suggested setting the NIXPACKS_PKGS variable to util-linux-minimal in variables, and JustJake suggested adding the variable.
⚠️ experimental feature
e629e6f4-8257-472b-8ef9-34809b5acd29
finally
working on something right now, ill be back soon
in the meantime, screenshots please
There we go, ofc just lmk if I'm missing anything
take your time, no rush at all, apologies for the wait haha
obligatory question, have you modified anything in your local node_modules folder?
also, callback hell
async but no await
no sir, never
can i see a screenshot of the variables tab in the service
just node v18
okay i was hoping so
yep, always
<a:aPES_Shake:513344618444881941>
little side track though, im seeing a few
'XXX'
meaning you stored secrets as plain text in your code?yeah, this is a one-off discord bot for a super small function
someone could get hold of that secret and it really wouldnt matter haha
still though, please use service variables going forward, its just good practice
service variables?
like that
but for your discord token
shit, railway keeps getting better, ill be sure to peep docs for how that works and get on it immediately, thanks dude!
add a variable in there then access it with process.env.<variable name>
you're the best
okay but thats not your issue
i have many
glad we could fix one
now back on track, locally, delete the node_modules folder then run
npm i
and tell me if your code still worksworked
side note
ill work on callback hell later
its just
const balance = await provider.getBalance('xxx');
is that less hellish
lol
sorry, i swear i didnt open this for JS lessons
ethBalance can be a const
done
ty sensei
is
client.channels.cache.get
a promise?dont believe so
would be if it was without cache
actually i may be confusing versions of discord.js
forget that
okay so at this point im just googleing for the error, so will you take over that for now
are you referring to:
What.... the sweet hell, I just deleted node modules again and it worked
<:PES_Cry:493359762432327691>
Are you deploying from git?
wdym? to railway?
from git to railway?
I sync changes to my repo and then railway redeploys
is my flow
So currently you have a .gitignore with
node_modules/
and theres now no node_modules folder on git?correct
and it works, no more undefined?
nope.
lol
okay well i dont know what was fixed but yay
it was your energy
the vibes
Thank you so much for taking the time, I'm sorry this didn't sort itself out cleanly, but I did seriously learn some really solid lessons from you in the process
haha thank you, glad it worked out