R
Railway3mo ago
Ori

Bun project with node-canvas not working

Hello, I'm trying to run a Discord Bot that uses node-canvas, but I'm getting some errors when it's running. Something to do with apt packages. This is the repo: https://github.com/Communivents/ceramique And the error:
149 | :icons_dgreen: **We will ask you to stop**

150 | :icons_dyellow: **You will get a warn**

151 | :icons_Wrong: **You will be banned from the server for 1 week**

152 | :icons_ban: **Permanent Ban**

153 |

154 | After all, be nice :m_Hug:`).setColor("#6246be")]}},Lo=[];for(let H of Object.keys(EZ))Lo.push({name:H,value:H});r2({data:new bH.SlashCommandBuilder().setName("embed").setDescription("Sends an embed by preset or json").setDefaultMemberPermissions(bH.PermissionFlagsBits.Administrator).addSubcommand((H)=>H.setName("json").setDescription("Send an embed from JSON").addStringOption((_)=>_.setName("embed").setRequired(!0).setDescription("JSON of the embed"))).addSubcommand((H)=>H.setName("preset").setDescription("Send an embed from a preset").addStringOption((_)=>_.setName("embed").setDescription("Preset embed to send").setRequired(!0).addChoices(...Lo))),async execute(H){const _=H.options.getString("embed");if(!_){H.reply(bH.blockQuote("Couldnt find the 'embed' string option."));return}switch(H.options.getSubcommand()){case"json":{const L=await H.channel?.send({embeds:[JSON.parse(_)]});H.reply({content:L?.url,ephemeral:!0});break}case"preset":{const L=Object.keys(EZ).find((N)=>N.toLowerCa



TypeError: libpixman-1.so.0: cannot open shared object file: No such file or directory

at /$bunfs/root/ceramique:154:8989

at /$bunfs/root/ceramique:2:685

at /$bunfs/root/ceramique:154:9183

at /$bunfs/root/ceramique:2:685

at /$bunfs/root/ceramique:196:12

at /$bunfs/root/ceramique:2:685

at /$bunfs/root/ceramique:204:3997

at /$bunfs/root/ceramique:2:685

at /$bunfs/root/ceramique:204:16731

at /$bunfs/root/ceramique:2:685

at /$bunfs/root/ceramique:204:17011

at /$bunfs/root/ceramique:2:814

at /$bunfs/root/ceramique:205:4477

at /$bunfs/root/ceramique:2:814

at /$bunfs/root/ceramique:205:6662

at /$bunfs/root/ceramique:2:814

at /$bunfs/root/ceramique:205:7730
149 | :icons_dgreen: **We will ask you to stop**

150 | :icons_dyellow: **You will get a warn**

151 | :icons_Wrong: **You will be banned from the server for 1 week**

152 | :icons_ban: **Permanent Ban**

153 |

154 | After all, be nice :m_Hug:`).setColor("#6246be")]}},Lo=[];for(let H of Object.keys(EZ))Lo.push({name:H,value:H});r2({data:new bH.SlashCommandBuilder().setName("embed").setDescription("Sends an embed by preset or json").setDefaultMemberPermissions(bH.PermissionFlagsBits.Administrator).addSubcommand((H)=>H.setName("json").setDescription("Send an embed from JSON").addStringOption((_)=>_.setName("embed").setRequired(!0).setDescription("JSON of the embed"))).addSubcommand((H)=>H.setName("preset").setDescription("Send an embed from a preset").addStringOption((_)=>_.setName("embed").setDescription("Preset embed to send").setRequired(!0).addChoices(...Lo))),async execute(H){const _=H.options.getString("embed");if(!_){H.reply(bH.blockQuote("Couldnt find the 'embed' string option."));return}switch(H.options.getSubcommand()){case"json":{const L=await H.channel?.send({embeds:[JSON.parse(_)]});H.reply({content:L?.url,ephemeral:!0});break}case"preset":{const L=Object.keys(EZ).find((N)=>N.toLowerCa



TypeError: libpixman-1.so.0: cannot open shared object file: No such file or directory

at /$bunfs/root/ceramique:154:8989

at /$bunfs/root/ceramique:2:685

at /$bunfs/root/ceramique:154:9183

at /$bunfs/root/ceramique:2:685

at /$bunfs/root/ceramique:196:12

at /$bunfs/root/ceramique:2:685

at /$bunfs/root/ceramique:204:3997

at /$bunfs/root/ceramique:2:685

at /$bunfs/root/ceramique:204:16731

at /$bunfs/root/ceramique:2:685

at /$bunfs/root/ceramique:204:17011

at /$bunfs/root/ceramique:2:814

at /$bunfs/root/ceramique:205:4477

at /$bunfs/root/ceramique:2:814

at /$bunfs/root/ceramique:205:6662

at /$bunfs/root/ceramique:2:814

at /$bunfs/root/ceramique:205:7730
GitHub
GitHub - Communivents/ceramique: Discord bot for the Communivents s...
Discord bot for the Communivents server. Contribute to Communivents/ceramique development by creating an account on GitHub.
16 Replies
Percy
Percy3mo ago
Project ID: e6306992-6a17-4995-84ea-cdbde3b351a7
Ori
OriOP3mo ago
e6306992-6a17-4995-84ea-cdbde3b351a7 Fixed it, but now getting an error:
./dist/ceramique: symbol lookup error: /tmp/.17feeefffeffffcb-00000000.node: undefined symbol: _ZN2v816FunctionTemplate16InstanceTemplateEv

error: script "start" exited with code 127
./dist/ceramique: symbol lookup error: /tmp/.17feeefffeffffcb-00000000.node: undefined symbol: _ZN2v816FunctionTemplate16InstanceTemplateEv

error: script "start" exited with code 127
And this now:
TypeError: /tmp/.7feefcbdbf4e4fbf-00000000.node: undefined symbol: _ZNK2v85Value8ToUint32ENS_5LocalINS_7ContextEEE
TypeError: /tmp/.7feefcbdbf4e4fbf-00000000.node: undefined symbol: _ZNK2v85Value8ToUint32ENS_5LocalINS_7ContextEEE
Adam
Adam3mo ago
This is a code issue, not an issue with Railway. You'll be better off Googling this than waiting for a response here
Ori
OriOP3mo ago
I tested this on 3 machines and it doesn't work on railway so Also I looked at every post on google and tried everything
Adam
Adam3mo ago
This is during build?
Ori
OriOP3mo ago
No, runtime
Adam
Adam3mo ago
Then it's a code error, sorry
Ori
OriOP3mo ago
It uses a compiled .node file so the error may go un noticed during build
Adam
Adam3mo ago
If the error doesn't give enough information, I suggest logging more
Ori
OriOP3mo ago
I don't control the build step of node-canvas...
Adam
Adam3mo ago
Did you not just say this is during runtime? As in, post build?
Ori
OriOP3mo ago
The build step works: it creates a binding for cario. Then when it is called, and only in railway, it crashes I tried my binary on Mac, linux and windows and in all scenarios it worked
Adam
Adam3mo ago
Found a couple Google results that may help, https://github.com/nodejs/docker-node/issues/277 https://github.com/Automattic/node-canvas/issues/1952 Add npm install ffi in your project, there's a missing binding I'm not super experienced at js so I likely won't be able to help further, but those threads should be a good starting point for you
Ori
OriOP3mo ago
node-canvas is a mess I ended up bumping the library I use captcha-canvas to v3 so it uses skia-canvas instead Now no errors Thanks for helping 👍
Adam
Adam3mo ago
No prob
Ori
OriOP3mo ago
Also using this dockerfile:
FROM oven/bun:latest

RUN apt-get update && \
apt-get install -y libfontconfig1 libfontconfig1-dev

WORKDIR /app

COPY package.json bun.lockb biome.jsonc tsconfig.json ./
COPY src ./src
COPY scripts ./scripts

RUN bun install

CMD ["bun", "run", "start"]
FROM oven/bun:latest

RUN apt-get update && \
apt-get install -y libfontconfig1 libfontconfig1-dev

WORKDIR /app

COPY package.json bun.lockb biome.jsonc tsconfig.json ./
COPY src ./src
COPY scripts ./scripts

RUN bun install

CMD ["bun", "run", "start"]
Want results from more Discord servers?
Add your server