Error when deploying discord bot

AnonymousTRIAL

a year ago

I've keep getting this error, I've been trying to fix this for months. Everything works fine on replit after I install and import the canvas node mod, but when I deploy to railway I get this error

0 Replies

AnonymousTRIAL

a year ago

Ok


AnonymousTRIAL

a year ago

Here


AnonymousTRIAL

a year ago

Btw, In order to make canvas work on replit I had to add this

{pkgs}: {
  deps = [
        pkgs.nodePackages.prettier
    pkgs.libuuid
  ];
  env = { LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [pkgs.libuuid];  }; 
}

To my replit.nix file


AnonymousTRIAL

a year ago

It fixed it on replit


a year ago

and we supposedly did that here too


AnonymousTRIAL

a year ago

Is this a common issue


a year ago

no, but try moving to a dockerfile based build


AnonymousTRIAL

a year ago

How do I do that? Is it just something I need to install on replit? I'm not very experienced with backend programming if you coudnt tell, I mostly just build websites so all of this is new to me


a year ago

try adding this as a Dockerfile to your project

FROM node:20.10.0-alpine

ENV NODE_ENV production
ENV NPM_CONFIG_UPDATE_NOTIFIER false
ENV NPM_CONFIG_FUND false

RUN apk add --update --no-cache \
    libuuid \
    python3 \
    build-base \
    pkgconf \
    pixman \
    cairo-dev \
    pango-dev \
    jpeg-dev \
    giflib-dev

WORKDIR /app

COPY package*.json ./

RUN npm ci

COPY . ./

CMD node src/index.js

AnonymousTRIAL

a year ago

Ok, and I just run it like normal?


a year ago

locally yes


AnonymousTRIAL

a year ago

Ok, so it says there's a error in the build logs


AnonymousTRIAL

a year ago

But it works fine on replit


a year ago

build logs please


AnonymousTRIAL

a year ago


a year ago

i have updated this, please update your Dockerfile too


AnonymousTRIAL

a year ago

I'm using node js btw not python


a year ago

yeah but node-gyp needs python


AnonymousTRIAL

a year ago

Oh alr


a year ago

might also need other things, but we will start with that


AnonymousTRIAL

a year ago

Yeah, same error


a year ago

thats not the same error


AnonymousTRIAL

a year ago

Oh


AnonymousTRIAL

a year ago

It looked the same


a year ago

it do look the same


a year ago

updated


AnonymousTRIAL

a year ago

Ok, another error


a year ago

what node version do you use locally?


AnonymousTRIAL

a year ago

I'm not sure, let me check


AnonymousTRIAL

a year ago

V20.10.0


AnonymousTRIAL

a year ago


a year ago

haha why didnt you tell me you dont use node 18 locally


a year ago

updated


AnonymousTRIAL

a year ago

Lol My b I didn't even know my version 😂


AnonymousTRIAL

a year ago


AnonymousTRIAL

a year ago

error


a year ago

nah it still needs python haha


a year ago

updated


AnonymousTRIAL

a year ago

Alr


a year ago

run it back


AnonymousTRIAL

a year ago

Allr


a year ago

okay that was a syntax error, my bad


a year ago

we will get there in the end lol


AnonymousTRIAL

a year ago

It's all g dw


AnonymousTRIAL

a year ago

Yes, it worked!!!


AnonymousTRIAL

a year ago

Thanks so much 🙂


AnonymousTRIAL

a year ago

I've been stuck with that issue for like 2 months 😭


a year ago

woohoo


carllippertHOBBY

a year ago

Hey im having a similar issue. I have used railway for lots of project but looks like someof my new dependencies break my happy path.

How can i know what to put in my docker file ( seems like the right path ) to solve this issue?

package -> node-vad
https://www.npmjs.com/package/node-vad

Failed Build Log


Error when deploying discord bot - Railway Help Station