Issue parsing space in node binary path when using with Laravel Herd #874
-
I'm having some issues when trying to use Browershot in a setup running through Laravel Herd. I am trying to set the node & npm binary's when calling browsershot, and in my setup these are defined in the ENV file and then through a config file. I'm passing in the Node / NPM binary paths from my config & env files like so:
My env values with the paths look like this:
However with the above I get the following error: I have tried to add a backslash to escape the space character which has been suggested in other discussion about this issue, like so:
But then my entire site drops and I get the following error:
My guess here is the .env file doesn't like parsing a backslash, so I've tried adding this path directly into the browsershot setup to see if it would work like so:
In this case I removed the lines from my env, which brings the site back up, but then I get a weird error when trying to generate a pdf with browsershot: There is a 200 response and no other information to go off of - I've tried generating multiple pdf's with fresh data etc so in theory it shouldn't be related to any sort of dodgy data on my end. But I'm very stumped! Does anyone have any suggestions? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Okay so I have figured out that the latest 'Failed to load PDF document' is a known bug related to Puppeteer v23 changes (fixed here #870) - which means this should work if I pass the path directly into that method. However, this isn't feasible in my project as every user has their own local path which is defined in the |
Beta Was this translation helpful? Give feedback.
Hi, in my case I got around this by creating a symlink in the project folder (or any directory without spaces). And just use that symlink path in your .env.
Or even you can create symlinks same as this package defaults (/usr/local/bin/node and /usr/local/bin/npm), if I'm not mistaken, and do not use set methods at all.