My Controller:
// other codes...
$name = 'invoice-' . $participant->id . '.pdf';
$data = [
'participant' => $participant,
'total' => $total,
'days' => $days,
'destinations' => $destinations,
'participation' => $participation,
'submission_fee' => $submission_fee,
'user' => $user
];
Pdf::view('front.documents.invoice', $data)
->save($name);
-> Laravel PDF composer package installed
-> npm install puppeteer executed
I tried these;
->setNodeBinary('/usr/local/bin/node')
->setNpmBinary('/usr/local/bin/npm');
I don't know if its important but i use herd on my MacBook.
AND I'M GETTIN THIS ERROR LIKE FOR 4 HOURS;
The command "PATH=$PATH:/usr/local/bin:/opt/homebrew/bin NODE_PATH=`npm root -g` node '/Users/is/Documents/GitHub/conference_system/vendor/spatie/browsershot/src/../bin/browser.cjs' '{"url":"file:\/\/\/var\/tmp\/1358724051-0570237001714435100\/index.html","action":"pdf","options":{"path":"invoice.pdf","args":[],"viewport":{"width":800,"height":600},"displayHeaderFooter":false,"printBackground":true}}'" failed. Exit Code: 1(General error) Working directory: /Users/is/Documents/GitHub/conference_system/public Output: ================ Error Output: ================ TimeoutError: Navigation timeout of 30000 ms exceeded at new Deferred (/Users/is/Documents/GitHub/conference_system/node_modules/puppeteer-core/lib/cjs/puppeteer/util/Deferred.js:59:34) at Deferred.create (/Users/is/Documents/GitHub/conference_system/node_modules/puppeteer-core/lib/cjs/puppeteer/util/Deferred.js:21:16) at new LifecycleWatcher (/Users/is/Documents/GitHub/conference_system/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/LifecycleWatcher.js:66:60) at CdpFrame.goto (/Users/is/Documents/GitHub/conference_system/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Frame.js:136:29) at CdpFrame.<anonymous> (/Users/is/Documents/GitHub/conference_system/node_modules/puppeteer-core/lib/cjs/puppeteer/util/decorators.js:98:27) at CdpPage.goto (/Users/is/Documents/GitHub/conference_system/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Page.js:585:43) at callChrome (/Users/is/Documents/GitHub/conference_system/vendor/spatie/browsershot/bin/browser.cjs:276:37)
Additionally;
I tried to switch Laravel DOMPDF package and it works but tailwind classes doesn't work on this package. I guess I have to write my own classes in style tag. There is so many pdf that I must create. Tailwind is a must in this circumstances.
OR ANY OTHER ADVICE