Puppeteer package update
I can run a command without this package, but need it for the host to opperate. They deprecated my packaged and it broke my command, I updated it and it's still not working. I'm not getting any errors, however my command just isn't working when hosted.
const outputFilePath = await convertFile(inputFilePath, {
puppeteer: {
headless: 'new',
args: ['--no-sandbox', '--disable-setuid-sandbox']
},
});
A rundown of the command, converts an SVG to a png. Uses the npm package "convert-svg-to-png". Everything still works locally, it's just when hosted the commands that use this code break. Not sure if anyone has any tips on where to start cause I've done 35 commits tonight and can't get it.
21 Replies
Project ID:
16ae5c85-ef95-4976-b025-d0f2b7ddfca3
16ae5c85-ef95-4976-b025-d0f2b7ddfca3
and theres no errors at all, anywhere?
Nope
The image just isn't being generated.
Locally it is tho
then theres not much to go off of, do you have error handling and logging in place already?
I do have a logger for errors but nothing pops of for this. No type or api errors
Trying something, will keep you posted
threw it in a try catch to log errors. Not sure why I waited this long to do this
sounds good, but yeah without errors theres not all that much we can do to help
Was getting different errors up until this point, now I'm out of them lmao
keep me posted
threw rhe try catch around the wrong block ðŸ˜
its too late to be dealing with problems <:Laughing_Clown:852881915140243497>
honestly id look into a way to convert svg to png without using chrome
i dont think you need me to tell you this, but that is a very fragile system
I threw the try catch to the "interaction.editReply({" block and got no errors. I can't have it above or it just disables it.
please consider this
I'll look into it more tomorrow
looks like sharp can do it https://github.com/lovell/sharp
let me try that rq
youll need this then, add this to a nixpacks.toml file in your project
Hijacking this thread, I also cannot run puppeteer. get this error and have the same set up as OP.
[0930/162038.763649:ERROR:zygote_host_impl_linux.cc(100)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
while the original poster may have gotten errors, this part of their code was correct
though the syntax when using puppeteer directly (and not through another wrapper) will be a little different
And as soon as I typed this, it works now
I didn't compile my ts to js before pushing. Is there a way to get railway run tsc on my .ts files?
add a build script to your package.json that runs the applicable tsc command to compile your ts, then your start script should be set up to run your compiled js