You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copying my issue report from puppeteer/puppeteer#10352, since puppeteer-core now depends on proxy-agent and other packages in this repo:
Bug expectation
I expected to be able to bundle my Puppeteer script with esbuild
My esbuild-bundled Puppeteer script failed (see full error output below) because of the transitive dependency on vm2 (via puppeteer-core -> proxy-agent -> pac-proxy-agent -> pac-resolver -> degenerator -> vm2)
$ node abc.mjs
node:fs:601
handleErrorFromBinding(ctx);
^
Error: ENOENT: no such file or directory, open '/home/runner/work/project/project/bridge.js'
at Object.openSync (node:fs:601:3)
at Object.readFileSync (node:fs:469:35)
at ../../node_modules/@puppeteer/browsers/node_modules/vm2/lib/vm.js (file:///home/runner/work/project/project/abc.mjs:52297:66)
at __require2 (file:///home/runner/work/project/project/abc.mjs:20:50)
at ../../node_modules/@puppeteer/browsers/node_modules/vm2/lib/main.js (file:///home/runner/work/project/project/abc.mjs:54169:9)
at __require2 (file:///home/runner/work/project/project/abc.mjs:20:50)
at ../../node_modules/@puppeteer/browsers/node_modules/vm2/index.js (file:///home/runner/work/project/project/abc.mjs:54197:22)
at __require2 (file:///home/runner/work/project/project/abc.mjs:20:50)
at ../../node_modules/@puppeteer/browsers/node_modules/degenerator/dist/index.js (file:///home/runner/work/project/project/abc.mjs:54211:17)
at __require2 (file:///home/runner/work/project/project/abc.mjs:20:50) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/home/runner/work/project/project/bridge.js'
}
Node.js v18.16.0
It appears to be related to this current problem with bundling vm2:
Seems like the first version that this happens with is puppeteer-core@20.4.0, which upgraded @puppeteer/browsers from 1.3.0 to 1.4.0, which added proxy-agent.
Minimal, reproducible example
Bundle any Puppeteer script such as the simple script below via esbuild like this:
importpuppeteerfrom'puppeteer';// TS/ESM are all supported.(async()=>{constbrowser=awaitpuppeteer.launch();constpage=awaitbrowser.newPage();awaitpage.goto('https://news.google.com/news/');awaitpage.screenshot({path: 'news.png',fullPage: true});awaitbrowser.close();})();
Error string
ENOENT: no such file or directory, open '/home/runner/work/project/project/bridge.js'
Puppeteer version
20.5.0
Node version
18.16.0
Package manager
pnpm
Package manager version
8.6.1
Operating system
macOS
The text was updated successfully, but these errors were encountered:
I saw the following warning: npm WARN deprecated vm2@3.9.19: The library contains critical security issues and should not be used for production! The maintenance of the project has been discontinued. Consider migrating your code to isolated-vm. Will it be difficult to migrate? Perhaps migration will solve this issue too.
Partly related to the original issue in the old repo:
Copying my issue report from puppeteer/puppeteer#10352, since
puppeteer-core
now depends onproxy-agent
and other packages in this repo:Bug expectation
I expected to be able to bundle my Puppeteer script with
esbuild
My
esbuild
-bundled Puppeteer script failed (see full error output below) because of the transitive dependency onvm2
(viapuppeteer-core
->proxy-agent
->pac-proxy-agent
->pac-resolver
->degenerator
->vm2
)It appears to be related to this current problem with bundling
vm2
:Seems like the first version that this happens with is
puppeteer-core@20.4.0
, which upgraded@puppeteer/browsers
from1.3.0
to1.4.0
, which addedproxy-agent
.Minimal, reproducible example
Bundle any Puppeteer script such as the simple script below via
esbuild
like this:index.ts
Error string
Puppeteer version
20.5.0
Node version
18.16.0
Package manager
pnpm
Package manager version
8.6.1
Operating system
macOS
The text was updated successfully, but these errors were encountered: