Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'launch' of undefined #15

Open
jaradi opened this issue Jul 29, 2020 · 10 comments
Open

Cannot read property 'launch' of undefined #15

jaradi opened this issue Jul 29, 2020 · 10 comments

Comments

@jaradi
Copy link

jaradi commented Jul 29, 2020

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.

@danestves
Copy link

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

@Spawnrad
Copy link

I having the same issue.

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

@myishay
Copy link

myishay commented Jun 28, 2022

same here

@thorwebdev
Copy link

thorwebdev commented Jul 13, 2022

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?

@albiesoft
Copy link

Same here

@Kang-Jerry-Github
Copy link

same here

1 similar comment
@TroutZen
Copy link

same here

@dgurns
Copy link

dgurns commented Sep 12, 2022

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

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

@agamm
Copy link

agamm commented Sep 14, 2022

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.

@6unpk
Copy link

6unpk commented Oct 18, 2022

also you can fix like this

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests