Error when deploying discord bot
Anonymous
TRIALOP

2 years 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

Anonymous
TRIALOP

2 years ago

Ok


Anonymous
TRIALOP

2 years ago

Here


Anonymous
TRIALOP

2 years 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


Anonymous
TRIALOP

2 years ago

It fixed it on replit


brody
EMPLOYEE

2 years ago

and we supposedly did that here too


Anonymous
TRIALOP

2 years ago

Is this a common issue


brody
EMPLOYEE

2 years ago

no, but try moving to a dockerfile based build


Anonymous
TRIALOP

2 years 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


brody
EMPLOYEE

2 years 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

Anonymous
TRIALOP

2 years ago

Ok, and I just run it like normal?


brody
EMPLOYEE

2 years ago

locally yes


Anonymous
TRIALOP

2 years ago

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


Anonymous
TRIALOP

2 years ago

But it works fine on replit


brody
EMPLOYEE

2 years ago

build logs please


Anonymous
TRIALOP

2 years ago


brody
EMPLOYEE

2 years ago

i have updated this, please update your Dockerfile too


Anonymous
TRIALOP

2 years ago

I'm using node js btw not python


brody
EMPLOYEE

2 years ago

yeah but node-gyp needs python


Anonymous
TRIALOP

2 years ago

Oh alr


brody
EMPLOYEE

2 years ago

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


Anonymous
TRIALOP

2 years ago

Yeah, same error


brody
EMPLOYEE

2 years ago

thats not the same error


Anonymous
TRIALOP

2 years ago

Oh


Anonymous
TRIALOP

2 years ago

It looked the same


brody
EMPLOYEE

2 years ago

it do look the same


brody
EMPLOYEE

2 years ago

updated


Anonymous
TRIALOP

2 years ago

Ok, another error


brody
EMPLOYEE

2 years ago

what node version do you use locally?


Anonymous
TRIALOP

2 years ago

I'm not sure, let me check


Anonymous
TRIALOP

2 years ago

V20.10.0


Anonymous
TRIALOP

2 years ago


brody
EMPLOYEE

2 years ago

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


brody
EMPLOYEE

2 years ago

updated


Anonymous
TRIALOP

2 years ago

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


Anonymous
TRIALOP

2 years ago


Anonymous
TRIALOP

2 years ago

error


brody
EMPLOYEE

2 years ago

nah it still needs python haha


brody
EMPLOYEE

2 years ago

updated


Anonymous
TRIALOP

2 years ago

Alr


brody
EMPLOYEE

2 years ago

run it back


Anonymous
TRIALOP

2 years ago

Allr


brody
EMPLOYEE

2 years ago

okay that was a syntax error, my bad


brody
EMPLOYEE

2 years ago

we will get there in the end lol


Anonymous
TRIALOP

2 years ago

It's all g dw


Anonymous
TRIALOP

2 years ago

Yes, it worked!!!


Anonymous
TRIALOP

2 years ago

Thanks so much 🙂


Anonymous
TRIALOP

2 years ago

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


brody
EMPLOYEE

2 years ago

woohoo


carllippert
HOBBY

2 years 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


Loading...