JupiterOne/playwright-aws-lambda

Error: ENOENT: no such file or directory, open '/var/task/node_modules/playwright-core/browsers.json'

BrunoQuaresma opened this issue · 1 comments

After upgrade Playwright to 1.9.2 this error is happening on Vercel functions.

2021-03-16T19:57:07.806Z	undefined	ERROR	Error: ENOENT: no such file or directory, open '/var/task/node_modules/playwright-core/browsers.json'
    at Object.openSync (fs.js:462:3)
    at Object.readFileSync (fs.js:364:35)
    at new Registry (/var/task/node_modules/playwright-core/lib/utils/registry.js:213:54)
    at new Playwright (/var/task/node_modules/playwright-core/lib/server/playwright.js:46:23)
    at Object.createPlaywright (/var/task/node_modules/playwright-core/lib/server/playwright.js:59:12)
    at setupInProcess (/var/task/node_modules/playwright-core/lib/inprocess.js:24:37)
    at Object.<anonymous> (/var/task/node_modules/playwright-core/lib/inprocess.js:42:18)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/var/task/node_modules/playwright-core/browsers.json'
}
RequestId: fafc5e6c-b338-4ba2-90b0-a019fd78923b Error: Runtime exited with error: exit status 1
Runtime.ExitError

Linking microsoft/playwright#5862 to it

// Edit: This should be fixed when using the latest Playwright dev version: npm install -D playwright-core@next. It's also included in the next stable version which gets released soon.