Browser Failed to Launch

I've gone to the github and reviewed all their support options. Only one relates to this issue, and that being that my node is below version 14. I'm at 16, so this shouldn't be a problem. The only other place I see, is the heroku section seen in SS 2. However, I can not figure out how to add this to my code, for it to function. Screenshot three supplies all my code files. I've tried adding it to the read and bot.js files. Both times it says "launch" is undefined. So ik I'm defiantly doing something wrong. @ me with possible solutions. Thanks!
28 Replies
Percy
Percy2y ago
Project ID: N/A
Castle
CastleOP2y ago
N/A
Percy
Percy2y ago
It may be necessary to add the --no-sandbox argument when launching the browser, as suggested by loop_cat in the second search result.
⚠️ experimental feature
Castle
CastleOP2y ago
I'm aware, but I simply don't know how to lmao
Brody
Brody2y ago
ill take a more in depth look, could you send your repo?
Castle
CastleOP2y ago
Brody
Brody2y ago
404
Castle
CastleOP2y ago
its private 1 min try now
Brody
Brody2y ago
works, ill have a look and get back to you
Castle
CastleOP2y ago
Why is my .env in there lmao All g
Brody
Brody2y ago
woops prob wanna move that into the service variables
Castle
CastleOP2y ago
ye doing that rn Discord dm'ed me and reset it lol.
Castle
CastleOP2y ago
Pretty neat
Brody
Brody2y ago
thats insanely impressive oh that was long ago, not the moment you made it public, still cool none the less
Castle
CastleOP2y ago
Welp, my gitignore just wont gnore the .env file lmao It was within 2 seconds of it going public I'm on MST so it's 2 hours behind EST
Brody
Brody2y ago
can't believe i just forgot about time zones, ignore that lol
Castle
CastleOP2y ago
lmao the gameday.js file is using the conver-svg-to-png package which uses chrome. Then fails to launch everything else works without flaw, but I'd like to use the converter for more commands. Just creating graphics within discord over launching photoshop is so nice. Partly cause there isn't photoshop mobile
Brody
Brody2y ago
okay i think i have found the solution but first delete the Procfile
Castle
CastleOP2y ago
Oh lol, that was for heroku I think
Brody
Brody2y ago
and then add a start command to your package.json like so
Castle
CastleOP2y ago
ohhh add it there gotcha not me still lost on how this relates to the error lmao but yes, I've done that
Brody
Brody2y ago
it doesnt okay so every time you call convertFile you will want to add the --no-sandbox arg like the errors tell you to and you do that like so
const outputFilePath = await convertFile(inputFilePath, {
puppeteer: {
args: ['--no-sandbox', '--disable-setuid-sandbox']
}
});
const outputFilePath = await convertFile(inputFilePath, {
puppeteer: {
args: ['--no-sandbox', '--disable-setuid-sandbox']
}
});
Castle
CastleOP2y ago
I'll give it a go rn Good sir, you're amazing. Thank you so much for the help, I haven't actual took a course on JS so it's kind of a trial and error while using stack overflow and yt to solve issues. I really need to take a course lol
Castle
CastleOP2y ago
oh lol Guess I didn't search hard enough thanks anyways, helped a ton
Brody
Brody2y ago
a tip for searching github issues, remove the default "is:issue is:open" and then search for your keyword but, glad i could help 🙂
Castle
CastleOP2y ago
oh cool, ill use that going forward!
Want results from more Discord servers?
Add your server