gboutte / nestjs-pdf

A library that allow you tu use puppeteer for PDF generation inside a wrapper for nestjs.
4 stars 2 forks source link

404 when downloading browser? #7

Open ringodotnl opened 7 months ago

ringodotnl commented 7 months ago

Use: browserInstallBaseUrl: 'https://storage.googleapis.com/chrome-for-testing-public',

it's changed recently.

gboutte commented 7 months ago

Hello, can you describe what is you problem ? And what code are you using ?

ringodotnl commented 3 days ago

it's been quiet a while but I found this note I made:

  // see https://github.com/gboutte/nestjs-pdf?search=1
  // see https://googlechromelabs.github.io/chrome-for-testing/
  // new prefix for browser what's missig is the buildId how to pass that ?
  // if you get 404's what you can do is:
  //  open file node_modules\@gboutte\nestjs-pdf\src\browser.service.ts
  // change line buildId: buildId, to buildId: <thebuildversion>,
  // thebuildversion can be found here https://googlechromelabs.github.io/chrome-for-testing/#stable like '122.0.6261.94' or '129.0.6668.100'

Maybe you change it already but after a fresh install I did get a spawn error so might not be solved yet ?

ringodotnl commented 3 days ago

[Nest] 61868 - 15/10/2024, 19:11:16 ERROR [ExceptionsHandler] spawn UNKNOWN Error: spawn UNKNOWN at ChildProcess.spawn (node:internal/child_process:421:11) at Object.spawn (node:child_process:761:9) at new Process \node_modules\@puppeteer\browsers\src\launch.ts:189:41)

Tried to modify the buildid to the latest but did get the above, so looks like the old note doesn't work anymore.

ringodotnl commented 3 days ago
PdfModule.forRoot({
  pdfOptions: {},
  hbsOptions: { templateDirectory: 'templates' },
  browser: Browser.CHROMEHEADLESSSHELL,
  headless: 'new',
  browserTag: BrowserTag.STABLE,
  useLockedBrowser: true,
  browserInstallBaseUrl: 'https://storage.googleapis.com/chrome-for-testing-public',

})

That's the config I use.