playwright-aws-lambda icon indicating copy to clipboard operation
playwright-aws-lambda copied to clipboard

Cannot read property 'launch' of undefined

Open jaradi opened this issue 4 years ago • 10 comments

Tried integrating playwright-aws-lambda with an existing project and got an error, so went back to basics, started a new npm project and followed the steps in the README as follows:

  • npm install playwright-core playwright-aws-lambda --save
  • copied the example under the Usage section and pasted it into my index file.
  • uploaded my function to lambda with nodejs12.x runtime.

When running the lambda I get the following error:

ERROR	Invoke Error 	{"errorType":"TypeError","errorMessage":"Cannot read property 'launch' of undefined","stack":
["TypeError: Cannot read property 'launch' of undefined","    at Object.launchChromium (/var/task/node_modules/playwright-
aws-lambda/dist/src/chromium.js:90:47)","    at processTicksAndRejections (internal/process/task_queues.js:97:5)","    at 
async Runtime.exports.handler (/var/task/index.js:8:21)"]}

Apologies if this is user error. I did some research before logging this to see if there was an obvious fix, and simplified the repro process by using the bare minimum example code instead of my own code.

jaradi avatar Jul 29 '20 01:07 jaradi

I'm having the same error, the versions that work for me is:

"playwright-aws-lambda": "^0.4.0",
"playwright-core": "^0.11.1",

But i need the newer version for the project that i'm working on

danestves avatar Jul 29 '20 03:07 danestves

I having the same issue.

"playwright-aws-lambda": "^0.8.0",
"playwright-core": "^1.22.2",

Spawnrad avatar Jun 21 '22 16:06 Spawnrad

same here

myishay avatar Jun 28 '22 21:06 myishay

Similar issue with

"playwright-aws-lambda": "^0.8.0",
"playwright-core": "^1.23.3",

TypeError: Cannot read properties of undefined (reading 'launchChromium')

Did anyone manage to workaround it?

thorwebdev avatar Jul 13 '22 16:07 thorwebdev

Same here

albiesoft avatar Jul 26 '22 14:07 albiesoft

same here

Kang-Jerry-Github avatar Aug 19 '22 01:08 Kang-Jerry-Github

same here

TroutZen avatar Aug 27 '22 05:08 TroutZen

hi all, ran into the same issue here. Was able to fix it by:

import { launchChromium } from 'playwright-aws-lambda/dist/src';

dgurns avatar Sep 12 '22 08:09 dgurns

hi all, ran into the same issue here. Was able to fix it by:

import { launchChromium } from 'playwright-aws-lambda/dist/src';

This fixed it for me too.

agamm avatar Sep 14 '22 17:09 agamm

also you can fix like this

import * as playwright from 'playwright-aws-lambda';

6unpk avatar Oct 18 '22 09:10 6unpk