[Bug]: Laravel 11 #215
Unanswered
vitormicillo
asked this question in
Q&A
Replies: 4 comments 7 replies
-
Same, is there any solution? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Error: Cannot find module 'puppeteer' Did you install puppeteer? |
Beta Was this translation helpful? Give feedback.
3 replies
-
can i use laravel-pdf without having npm at my production server !!? |
Beta Was this translation helpful? Give feedback.
4 replies
-
same issue here! this package was legitimately working with previous Laravel versions! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What happened?
When I use the function to generate the pdf, laravel returns this error
The command "PATH=$PATH:/usr/local/bin:/opt/homebrew/bin NODE_PATH=
npm root -gnode '/Users/user/Development/coral_core2.0/laravel/vendor/spatie/browsershot/src/../bin/browser.cjs' '{"url":"file:\/\/\/var\/folders\/7d\/62pqlypj41zdjk45c94w1x900000gn\/T\/1968630093-0677519001737731718\/index.html","action":"pdf","options":{"args":[],"viewport":{"width":800,"height":600},"displayHeaderFooter":false,"format":"a4","printBackground":true}}'" failed. Exit Code: 1(General error) Working directory: /Users/vitormicillo/Development/coral_core2.0/laravel/public Output: ================ Error Output: ================ node:internal/modules/cjs/loader:1409 const err = new Error(message); ^ Error: Cannot find module 'puppeteer' Require stack: - /Users/vitormicillo/Development/coral_core2.0/laravel/vendor/spatie/browsershot/bin/browser.cjs at Function._resolveFilename (node:internal/modules/cjs/loader:1409:15) at defaultResolveImpl (node:internal/modules/cjs/loader:1060:19) at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1065:22) at Function._load (node:internal/modules/cjs/loader:1214:37) at TracingChannel.traceSync (node:diagnostics_channel:322:14) at wrapModuleLoad (node:internal/modules/cjs/loader:234:24) at Module.require (node:internal/modules/cjs/loader:1495:12) at require (node:internal/modules/helpers:135:16) at callChrome (/Users/vitormicillo/Development/coral_core2.0/laravel/vendor/spatie/browsershot/bin/browser.cjs:70:28) at Object.<anonymous> (/Users/vitormicillo/Development/coral_core2.0/laravel/vendor/spatie/browsershot/bin/browser.cjs:441:5) { code: 'MODULE_NOT_FOUND', requireStack: [ '/Users/vitormicillo/Development/coral_core2.0/laravel/vendor/spatie/browsershot/bin/browser.cjs' ] } Node.js v23.6.0
How to reproduce the bug
This is how I use my function:
` $pdf = Pdf::view('reports.pdf.alert-report', ['record' => $record])
->format('a4')
->download('alert-report.pdf');
the route is very simple too
Route::get('/generate-alert-pdf-report/{id}', [AlertResource::class, 'generatePdfReport'])->name('alert.report.pdf');
Package Version
1.5
PHP Version
8.4.2
Laravel Version
11.9
Which operating systems does with happen with?
macOS
Notes
No response
Beta Was this translation helpful? Give feedback.
All reactions