Replies: 3 comments 2 replies
-
My cache path is /root/.cache/puppeteer |
Beta Was this translation helpful? Give feedback.
-
Solved the problem following these steps:
See Puppeteer documentation This worked for me. PHP Version8.2.7 Laravel Version10.10 spatie/laravel-pdf Version1.5 Operating systemLinux - CentOS Stream 9 |
Beta Was this translation helpful? Give feedback.
-
@MichaelCorrea478 when the installation process finish the file the same file should be added in every project that uses puppeteer? Thanks |
Beta Was this translation helpful? Give feedback.
-
What happened?
Laravel spatie pdf works well on Mac local env but upon deploying on Ubuntu server am getting some errors.
How to reproduce the bug
When I hit the endpoint to generate pdf I see the error below
Symfony \ Component \ Process \ Exception \ ProcessFailedException
The command "PATH=$PATH:/usr/local/bin:/opt/homebrew/bin NODE_PATH=
npm root -g
node '/var/www/experts/backend/vendor/spatie/browsershot/src/../bin/browser.cjs' '{"url":"file:///tmp/512163753-0320285001705991912/index.html","action":"pdf","options":{"args":[],"viewport":{"width":800,"height":600},"displayHeaderFooter":false,"printBackground":true}}'" failed. Exit Code: 1(General error) Working directory: /var/www/experts/backend/public Output: ================ Error Output: ================ �[1m�[43m�[30m Puppeteer old Headless deprecation warning:�[0m�[33m In the near futureheadless: true
will default to the new Headless mode for Chrome instead of the old Headless implementation. For more information, please see https://developer.chrome.com/articles/new-headless/. Consider opting in early by passingheadless: "new"
topuppeteer.launch()
If you encounter any bugs, please report them to https://github.com/puppeteer/puppeteer/issues/new/choose.�[0m Error: Could not find Chrome (ver. 119.0.6045.105). This can occur if either 1. you did not perform an installation before running the script (e.g.npx puppeteer browsers install chrome
) or 2. your cache path is incorrectly configured (which is: /root/.cache/puppeteer). For (2), check out our guide on configuring puppeteer at https://pptr.dev/guides/configuration. at ChromeLauncher.resolveExecutablePath (/var/www/experts/backend/node_modules/puppeteer/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ProductLauncher.js:278:27) at ChromeLauncher.executablePath (/var/www/experts/backend/node_modules/puppeteer/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:209:25) at ChromeLauncher.computeLaunchArguments (/var/www/experts/backend/node_modules/puppeteer/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:103:37) at async ChromeLauncher.launch (/var/www/experts/backend/node_modules/puppeteer/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ProductLauncher.js:69:28) at async callChrome (/var/www/experts/backend/vendor/spatie/browsershot/bin/browser.cjs:91:23)Package Version
spatie/laravel-pdf version 1.1
PHP Version
8.1.27
Laravel Version
10.10
Which operating systems does with happen with?
Linux
Notes
This works well when developing on macOs locally. But fails on Ubuntu server.
Beta Was this translation helpful? Give feedback.
All reactions