这是indexloc提供的服务,不要输入任何密码
Skip to content

[Bug]: Monorepo breaks build for Cloud Functions #9128

@flovouin

Description

@flovouin

Bug description

Steps to reproduce the problem:

  1. Depend on puppeteer 19.0.0 in a Cloud Function.
  2. Deploy the Cloud Function, the build succeeds.
  3. Invoke the Cloud Function, the error below occurs.

My guess is that the new cache location is not retained in the final Docker image for the Cloud Function. Although the build (and probably the download of Chromium) succeeds, Chromium is not available at runtime.

While the Cloud Function environment is not a direct concern of the puppeteer project, the caching feature introduced in 19.0.0 makes it hard to reliably install Chromium in an environment where we don't control the build/file system. I've tried playing around with PUPPETEER_CACHE_DIR, but again, we have very little guarantees over the build flow and it potentially changing.

Instead of specifying a download location using PUPPETEER_CACHE_DIR, is there any way the old behaviour can optionally be turned on, and let puppeteer figure out where it's installed? This would avoid having to know the subtlety of the underlying build/file system.

Thanks,

Puppeteer version

19.0.0

Node.js version

16

npm version

8.5.0

What operating system are you seeing the problem on?

Linux

Relevant log output

Error: Could not find expected browser (chrome) locally. Run `npm install` to download the correct Chromium revision (1045629).

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions