[BUG] Cannot find module 'puppeteer-core/lib/Browser'
See original GitHub issueTrying to execute README example, the following error occurred.
Environment
chrome-aws-lambda
Version: 3.1.1puppeteer
/puppeteer-core
Version: 5.1.0- OS: Linux
- Node.js Version: 12.x
- Lambda / GCF Runtime: nodejs12.x
Expected Behavior
Should have returned example.com content.
Current Behavior
Following error occurs:
Lambda execution failed with status 200 due to customer function error: Cannot find module 'puppeteer-core/lib/Browser'
Require stack:
- /var/task/node_modules/chrome-aws-lambda/source/puppeteer/lib/Browser.js
- /var/task/node_modules/chrome-aws-lambda/source/index.js
- /var/task/app.js
No Browser module expored in the following path: ‘puppeteer-core/lib/Browser’
Steps to Reproduce
Lambda functions: memory is 1024M, timeout is 3000ms.
const chromium = require('chrome-aws-lambda');
exports.handler = async (event, context, callback) => {
let result = null;
let browser = null;
try {
browser = await chromium.puppeteer.launch({
args: chromium.args,
defaultViewport: chromium.defaultViewport,
executablePath: await chromium.executablePath,
headless: chromium.headless,
ignoreHTTPSErrors: true,
});
let page = await browser.newPage();
await page.goto(event.url || 'https://example.com');
result = await page.title();
} catch (error) {
return callback(error);
} finally {
if (browser !== null) {
await browser.close();
}
}
return callback(null, result);
};
Issue Analytics
- State:
- Created 3 years ago
- Reactions:18
- Comments:16
Top Results From Across the Web
Cannot find module 'puppeteer-core/internal/common/Device.js'
I was able to fix it with: npm i puppeteer@18.1.0. Then adding chrome.exe from Windows to my $PATH. And changing the test to...
Read more >Troubleshooting - Puppeteer
The most common cause is a bug in Node.js v14.0.0 which broke extract-zip , the module Puppeteer uses to extract browser downloads into...
Read more >Puppeteer - npm
Puppeteer is a Node.js library which provides a high-level API to control Chrome/Chromium over the DevTools Protocol.
Read more >Browser Automation - Laracasts
I got this error in the browser. { "errorType": "Error", "errorMessage": "Cannot find module '/var/task/node_modules/puppeteer-core/ ...
Read more >cannot find module [Node npm Error Solved] - freeCodeCamp
If you're a developer that works with Node JS and JavaScript libraries and frameworks like React, Vue, and Angular, then you might have ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
13.7.0 works fine for me
Also downgrading to versions 3.0.4 of
chrome-aws-lambda
andpuppeteer-core
works for me