[Bug]: Not working with Laravel Sail #37
Replies: 3 comments
-
I don't see this as a bug in our code. If you figure out how to run this package within Sail, feel free to PR the instructions to our docs. |
Beta Was this translation helpful? Give feedback.
-
Commenting just to say I am also having the same issue and unable to configure it to run with Sail. |
Beta Was this translation helpful? Give feedback.
-
For those wondering: You have to configure chromium in your docker and let browsershot know about it I successfully followed these instructions: Via Pdf you can access the Browsershot instance
PS. Does anyone know why all issues are transformed into discussions? Just curious. |
Beta Was this translation helpful? Give feedback.
-
What happened?
I received an error when using the package in its most basic form on a project using Laravel Sail.
The command:
$pdf = \Spatie\LaravelPdf\Facades\Pdf::view('pdfs.dispatch-sheet', (new DispatchSheetResource($this->load))->resolve())
->format(Format::Letter)
->save('Dispatch_Sheet_PO_' . $this->load->po_number . '.pdf');
The error:
How to reproduce the bug
I am pretty sure this occurred because I am using Laravel Sail, which has its own PHP environment in a Docker container that cannot launch the headless Chromium browser process needed to convert the blade template to a PDF.
The steps to reproduce:
Package Version
1.1.0
PHP Version
8.2.14
Laravel Version
10.39.0
Which operating systems does with happen with?
Linux
Notes
I intend to use Laravel-PDF to generate a PDF attached to a simple mail message using a Laravel Notification inside a synchronous Job. It's not getting that far yet, as the
->save()
method throws the above error before it gets to the Notification part of the Job.Beta Was this translation helpful? Give feedback.
All reactions