question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

errorMessage 'Cannot read property 'launch' of undefined

See original GitHub issue

Hello, I’m running the example code using Netlify functions and receiving the following error - { "errorType": "TypeError", "errorMessage": "Cannot read property 'launch' of undefined", "trace": [ "TypeError: Cannot read property 'launch' of undefined", " at Object.launchChromium (/var/task/src/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/src/makescreengrab.js:8:25)" ] }

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
austinkellehercommented, Jul 20, 2020

Hey @jamesgrubb. Try using const context = await browser.newContext(); instead. .defaultContext() is no longer supported in playwright-core.

0reactions
Q0commented, Aug 22, 2022

what could be a problem?

use

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Question] "Cannot read property 'launch' of undefined" #3084
Hi Team, I am playing with AWS Lambda and Playwright. with "playwright-aws-lambda": "^0.5.2", "playwright-core": "^1.0.1", works fine but ...
Read more >
Puppeteer launcher error results with undefined - Stack Overflow
Works import Puppeteer, { Browser, PDFOptions } from "puppeteer"; browser = await Puppeteer.launch({}); // Doesn't work import { launch, ...
Read more >
Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError : Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >
Error message: Cannot read property getInstance of undefined
Error message : Cannot read property getInstance of undefined · Click at the top of the Omni-bar where it says Secure and choose...
Read more >
puppeteer-chat/Lobby - Gitter
... TypeError: Cannot read property 'toString' of undefined. i tried . ... my code works when i do const browser = await puppeteer.launch({headless:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found