[Bug]: browser.cjs does not recognize nullish coalescing operator on production #249
-
What happened?When moving from local dev to production server, laravel-pdf throws the following error when generating a test pdf:
No changes between production and local dev config How to reproduce the bugA job calls a service, which calls the Pdf::view() function. Library call:
testPDF.blade.php:
Package Version1.5.5 PHP Version8.3.20 Laravel Version11.44.0 Which operating systems does with happen with?Linux NotesFollowed the steps to resolve similar issues to no solution. Setting
to
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
My bad, my job environment was running Node v12.22 and the node version I pointed it to was the same executable the process found automatically. I found the path to the correct version, and had to install chromium manually. Still having an issue that I'm not sure how to solve... In the boot method of my AppServiceProvider.php, I define the defaults for the laravel-pdf like so:
but when creating a PDF, I get a |
Beta Was this translation helpful? Give feedback.
-
Turns out the answer was pretty simple. I had installed the snap version of chromium, which is more restricted in the files it can access than the I solved this by removing the snap version of chromium, installing the
|
Beta Was this translation helpful? Give feedback.
-
So to summarize, the original issue was that the queue workers were using an old version of Node. To fix that, I used the default() function to make sure that every instance of Pdf uses the correct node version which I found using This resulted in the following error:
Which I resolved by manually installing chromium with The issue was fully resolved by removing the snap version of chromium browser, installing the
|
Beta Was this translation helpful? Give feedback.
So to summarize, the original issue was that the queue workers were using an old version of Node.
To fix that, I used the default() function to make sure that every instance of Pdf uses the correct node version which I found using
which node
.This resulted in the following error:
Which I resolved by manually i…