build failed without changes
d1hui
HOBBYOP

2 years ago

not very good at coding im just hosting this bot but it suddenly stopped working without changes

project id: a905169b-c3cb-4af1-a24e-5b5fac02d6cb

77 Replies

brody
EMPLOYEE

2 years ago

node 16 is no longer supported


d1hui
HOBBYOP

2 years ago

uh what does that mean and how do i fix this


brody
EMPLOYEE

2 years ago

uh what does that mean

I'm sorry but I'm not sure how I could clarify further.

how do i fix this

set your engines.node to 18 in the package.json


d1hui
HOBBYOP

2 years ago

hi sorry for the late reply


d1hui
HOBBYOP

2 years ago

thjeres no engines.node in package.json


d1hui
HOBBYOP

2 years ago

this is the closest thing i have in package-lock.json

1247491041880440800


d1hui
HOBBYOP

2 years ago

and someone told me to set this to 16 and now ive changed it to 18 but it still doesnt work

1247491129268637700


d1hui
HOBBYOP

2 years ago


d1hui
HOBBYOP

2 years ago

i think the errors are different thouhg


d1hui
HOBBYOP

2 years ago


d1hui
HOBBYOP

2 years ago


brody
EMPLOYEE

2 years ago

add python to the list of providers in your service settings on railway


d1hui
HOBBYOP

2 years ago

sorry how exactly do i do that


d1hui
HOBBYOP

2 years ago

is it like this?

1247689030368498000


brody
EMPLOYEE

2 years ago

not quite, please look into your service settings, you will find a providers option, add python with the dropdown


d1hui
HOBBYOP

2 years ago

ok i think got it but its still broken

1247691278116716624


d1hui
HOBBYOP

2 years ago

oh oops the log got cut off


brody
EMPLOYEE

2 years ago

in the future please use this -


brody
EMPLOYEE

2 years ago

are you using canvas in your project


d1hui
HOBBYOP

2 years ago

i dont think so?


d1hui
HOBBYOP

2 years ago

if youre talking about this

1247692380103114800


brody
EMPLOYEE

2 years ago

nope, I'm talking about your code


d1hui
HOBBYOP

2 years ago

uhhh i didnt code this im just hosting it so i really dont know


d1hui
HOBBYOP

2 years ago

also the bookmarklet doesnt seem to be working for me it just opens a blank page


brody
EMPLOYEE

2 years ago

follow the steps


brody
EMPLOYEE

2 years ago

I'll be brutally honest, it's going to be hard to host a project you don't know anything about, and by extension even harder for me to help you


d1hui
HOBBYOP

2 years ago

yea sorry its just that its been working for like 2 years and just randomly stopped


d1hui
HOBBYOP

2 years ago

i could asked the person that coded it if you want


brody
EMPLOYEE

2 years ago

you have access to the codebase right? can you send me the package.json please


d1hui
HOBBYOP

2 years ago


brody
EMPLOYEE

2 years ago

okay thanks, I have an idea that I will put together when I'm back at the computer


d1hui
HOBBYOP

2 years ago

ok ty for your help take your time


brody
EMPLOYEE

2 years ago

try adding this as a railway.json file to your project -

{
  "$schema": "https://railway.app/railway.schema.json",
  "build": {
    "builder": "NIXPACKS",
    "nixpacksPlan": {
      "providers": ["node"],
      "phases": {
        "setup": {
          "nixPkgs": ["...", "python3", "gcc"],
          "aptPkgs": ["...", "build-essential", "libcairo2-dev", "libpango1.0-dev", "libjpeg-dev", "libgif-dev", "librsvg2-dev"]
        }
      }
    }
  },
  "deploy": {
    "startCommand": "node index.js "
  }
}

d1hui
HOBBYOP

2 years ago


d1hui
HOBBYOP

2 years ago

that also didnt work


brody
EMPLOYEE

2 years ago

im guessing you really do need node 14, but nixpacks no longer supports node 14


brody
EMPLOYEE

2 years ago

please tell me the timestamp of the last build that did work


d1hui
HOBBYOP

2 years ago

4th of april


brody
EMPLOYEE

2 years ago

year?


d1hui
HOBBYOP

2 years ago

2024


brody
EMPLOYEE

2 years ago

thanks, where are you obtaining this date from?


d1hui
HOBBYOP

2 years ago

i have a log that tracks when the bot goes online and that was the last one


brody
EMPLOYEE

2 years ago

im sorry but thats not what i was asking for


d1hui
HOBBYOP

2 years ago

oh


d1hui
HOBBYOP

2 years ago

what did you mean then


brody
EMPLOYEE

2 years ago

i would like the timestamp for the last railway build that worked


d1hui
HOBBYOP

2 years ago

yea i went back to railway and checked it should be the same

1247700191167910000


d1hui
HOBBYOP

2 years ago

also i did notice the bot started failing while it was still running fine if that helps


brody
EMPLOYEE

2 years ago

okay thank you, just needed to be sure the date was from railway


brody
EMPLOYEE

2 years ago

are you able to share a link to the repo?



brody
EMPLOYEE

2 years ago

so quick question, where is the railway.json?


d1hui
HOBBYOP

2 years ago

oh this is the original one


d1hui
HOBBYOP

2 years ago

i added it to mine


brody
EMPLOYEE

2 years ago

whats different about yours?


d1hui
HOBBYOP

2 years ago

it should be the same but all the config is filled in and with the railway.json you sent


brody
EMPLOYEE

2 years ago

okay sounds good, ill try some different approaches to get this repo to deploy


brody
EMPLOYEE

2 years ago

i was able to get the repo to deploy.

Remove the railway.json and Procfile, add a Dockerfile with this in it -

FROM node:14-slim

ENV NPM_CONFIG_UPDATE_NOTIFIER=false
ENV NPM_CONFIG_FUND=false

WORKDIR /app

COPY package*.json ./

RUN npm ci

COPY . ./

CMD ["node", "index.js"]

d1hui
HOBBYOP

2 years ago

do i just name the file Dockerfile with no extension?


d1hui
HOBBYOP

2 years ago


brody
EMPLOYEE

2 years ago

correct


brody
EMPLOYEE

2 years ago

please use the bookmarklet


d1hui
HOBBYOP

2 years ago

oh right sorry


d1hui
HOBBYOP

2 years ago


brody
EMPLOYEE

2 years ago

please send your package.json, not the package.json from the repo you sent me


d1hui
HOBBYOP

2 years ago

this is the one


brody
EMPLOYEE

2 years ago

thanks, just needed to be sure


brody
EMPLOYEE

2 years ago

copy the package.json and package-lock.json files from this repo into yours


d1hui
HOBBYOP

2 years ago

ok now it successsfully deployed but crashed after


brody
EMPLOYEE

2 years ago

what error?


d1hui
HOBBYOP

2 years ago


brody
EMPLOYEE

2 years ago

interesting, this is proving to be difficult


d1hui
HOBBYOP

2 years ago

it used to also spam errors like this in deploy logs but it never affected anything so i just ignored it


brody
EMPLOYEE

2 years ago

in your dockerfile change node:14-slim to node:16-slim


d1hui
HOBBYOP

2 years ago

yooo that worked!


d1hui
HOBBYOP

2 years ago

tysm for your time


brody
EMPLOYEE

2 years ago

happy to help


Loading...