Replies: 6 comments 7 replies
-
Did you manage to fix this? |
Beta Was this translation helpful? Give feedback.
-
My friend is having the same problem with xampp/browsershot, did you manage to fix this? |
Beta Was this translation helpful? Give feedback.
-
I solved this by using Laravel Sail on Windows with wsl2. |
Beta Was this translation helpful? Give feedback.
-
Hello, Was getting error which was fixed by adding path to node, but still had issues
Next error was quite vague and toook me some time to work it out ### System / Package Versions node available in windows path, accessible from cmd prompt / terminal Was getting error as mentioned here laravel-pdf Bug#70 I have commented by journey of tracing the issue potentially to browsershot not sending env to process that runs puppeteer, not sure it is due to browsershot or how artisan serve works - I understand this problem is not occuring on Linux and other services, but I really needed to run on windows as this is my dev platform - though I deploy on ubuntu machines mostly. after much code diving, it seemed that the process of puppeteer being run by browsershot was not getting any environment variables, I traced the process creation to line 1032 in file vendor/spatie/browsershot/src/Browsershot.php my pdf code is
also am sending the whole env of laravel, not sure if that is right or not - am currently running this locally |
Beta Was this translation helpful? Give feedback.
-
Still not working in Laravel 10 |
Beta Was this translation helpful? Give feedback.
-
Hello
I am trying to make Spatie Browsershot work on Windows with XAMPP.
Windows 11
node v18.16.0
XAMPP - latest, with PHP 8.2.4
puppeteer - v20.2.0
spatie/browsershot": v3.57
First of all I installed
puppeteer
:At first, I wanted to output the result directly to the browser, so I had the following code in the controller:
But then I get the following error:
So then I tried to do the following (though not sure it's a good option for Windows, but it did make the above error disappear):
And the error above disappeared, however the page was blank, so something seems to still not work, but no errors.
Edit: When I
dd(Browsershot::html('<h1>Test</h1>')->setNodeBinary('PATH %~dp0;%PATH%;')->pdf());
, I get""
(empty string)..So instead of trying to output the PDF to the browser, I tried to save it as a pdf file:
But I got a new error:
I also tried several other paths:
or
But I get the same error.
I even tried uninstalling the global puppeteer and installing it only in my project:
And even installing chromium:
Nothing makes it work
Why?
Beta Was this translation helpful? Give feedback.
All reactions