Skip to content

Puppeteer updated caching directory #133

Open
@isabella-projects

Description

@isabella-projects

What version of pkg are you using?

6.2.0

What version of Node.js are you using?

locally latest, but specified node20-win-x64 when running pkg cmd

What operating system are you using?

Windows

What CPU architecture are you using?

x86_64

What Node versions, OSs and CPU architectures are you building for?

node20

Describe the Bug

When trying to build an application which has puppeteer 24.0.0 , it always throws the warning:

Warning Cannot include directory %1 into executable.
The directory must be distributed with executable as %2.
%1: node_modules\puppeteer.local-chromium
%2: path-to-executable/puppeteer
Warning Babel parse has failed: Unexpected token, expected "from" (1:12)
Warning Failed to make bytecode node20-x64 for file C:\snapshot\my_app\node_modules\typed-query-selector\shim.d.ts

I already tried copying the the .cache directory from %HOME%/.cache , where is the chrome.exe to the root of my project. Also by following the steps from: https://pptr.dev/guides/configuration#changing-the-default-cache-directory didn't do the trick.
Nevertheless the puppeteer package also uses ES6 inside typed-query-selector, which causes the warnings after the first one.

Expected Behavior

Should locate the executable from the .cache folder in your root project directory when specified in the .puppeterrc.js:

const {join} = require('path');

/**
 * @type {import("puppeteer").Configuration}
 */
module.exports = {
  // Changes the cache location for Puppeteer.
  cacheDirectory: join(__dirname, '.cache', 'puppeteer'),
};

To Reproduce

  1. Install latest Puppeteer version
  2. Run pkg app.js -t node20-win-x64
  3. Warnings occur, even though the application is running properly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions