Skip to content

Commit

Permalink
Merge pull request #23 from Gavant/upgrade-node-20
Browse files Browse the repository at this point in the history
upgrade to node 20 and other misc improvements
  • Loading branch information
bakerac4 authored May 6, 2024
2 parents edde36c + c03289d commit dc331e5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v3
- uses: volta-cli/action@v1
with:
node-version: 18.x
node-version: 20.x
yarn-version: 1.x
- name: Install Dependencies
run: yarn install
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"access": "public"
},
"volta": {
"node": "18.16.0",
"node": "20.9.0",
"yarn": "3.6.4"
}
}
8 changes: 5 additions & 3 deletions src/services/pdf-generation.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { executablePath } from 'puppeteer';
import puppeteer, { PDFOptions } from 'puppeteer-core';
import report from 'puppeteer-report';

Expand Down Expand Up @@ -41,11 +42,12 @@ export default class PdfGenerationService {
}

async launchBrowser(pdfGenerationRequest: PdfGenerationRequest) {
const chromiumPath = await chromium.executablePath();
const chromiumPath = process.env.IS_LOCAL ? executablePath() : await chromium.executablePath();
const options = {
args: chromium.args,
args: process.env.IS_LOCAL ? process.env.BROWSER_ARGS?.split(',') ?? ['--no-sandbox'] : chromium.args,
defaultViewport: chromium.defaultViewport,
executablePath: chromiumPath,
headless: !!process?.env?.BROWSER_HEADLESS === false ? false : true,
headless: chromium.headless as boolean,
...pdfGenerationRequest.browserOptions
};

Expand Down

0 comments on commit dc331e5

Please sign in to comment.